Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn settings menu to a dialog window #605

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

rpallai
Copy link
Contributor

@rpallai rpallai commented Jun 23, 2019

I hope Qt Designer is not banned.

Closes #553.

@rpallai rpallai changed the title Turn settings menu into a dialog window Turn settings menu to a dialog window Jun 23, 2019
Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qt Designer is certainly not banned, and I agree that using it for a preferences window is reasonable. What I can't accept though is that on my machine the preferences dialog is too small for the contents, with scrollbars in both directions even though there's enough room on the screen to make the dialog larger. Can you please somehow bind the size of the dialog to its contents up to a certain limit?

One more suboptimal thing: I understand that tabs are almost inevitable in the long term. But having both tabs and groups looks really over the top. I'd probably favour tabs over bigger captions. Or, if you prefer everything to be on a single page (I fully agree it's better from usability perspective) then hide the tab strip until it's really needed.

@rpallai
Copy link
Contributor Author

rpallai commented Jun 30, 2019

If I'm not mistaken, the window size issue is fixed, please test. The tab strip has been hidden for now.

@KitsuneRal
Copy link
Member

Still not :(
Capture

@KitsuneRal KitsuneRal added the enhancement A feature or change request for Quaternion label Jul 1, 2019
@rpallai
Copy link
Contributor Author

rpallai commented Jul 1, 2019

It must be good now.

@KitsuneRal
Copy link
Member

Finally got to this - thanks, it works pretty much as expected now. Would you please rebase it to the latest master (and, if you don't mind, add a tab with fonts configuration)?

@rpallai
Copy link
Contributor Author

rpallai commented Aug 31, 2019

Rebased and font settings have been exposed. I think adding tabs is unnecessary for now as the settings window is still pretty short.

Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I have one major piece of feedback regarding the font part - instead of a pair of combo boxes it would probably be better to use a font dialog (despite the dialog-over-dialog ugliness). The reason here is that some fonts have a few weights that can be equally fitting (light, regular and semibold, e.g.), and 6-18 range for font sizes might not be quite right for some extreme cases. In other words, a platform-native font dialog would certainly cover the use case better than the font configuration approximation with two combo boxes. What do you think?

</property>
</widget>
</item>
</layout>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the attempt to reduce the number of popups but is there any other reason not to use a button summoning a QFontDialog?

const auto curUIFontPointSize = SettingsGroup("UI").value("Fonts/pointSize", "");
uiFontPointSize->setCurrentIndex(curUIFontPointSize.toInt() - 6);

connect(uiFontPointSize, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, [this](const QString &text) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use QComboBox::currentTextChanged() that would lend for a more concise syntax (assuming we keep the two combo boxes instead of a font dialog)?

Ui_GeneralPage::setupUi(this);

// uiFont
const auto curUIFontFamily = SettingsGroup("UI").value("Fonts/family", "").toString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI, the recent lib has Settings::get template method that allows to write as follows (I'm not really pushing it as it's arguably slightly less readable):

Suggested change
const auto curUIFontFamily = SettingsGroup("UI").value("Fonts/family", "").toString();
const auto curUIFontFamily = SettingsGroup("UI").get("Fonts/family", QString());

// timelineFont
const auto curTimelineFontFamily = SettingsGroup("UI").value("Fonts/timeline_family", "").toString();
timelineFontFamily->insertItem(0, tr("system default"));
if (curTimelineFontFamily == "") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (curTimelineFontFamily == "") {
if (curTimelineFontFamily.isEmpty()) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for Quaternion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trade most of the Settings menu for a Preferences dialog window
2 participants