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

Make font size configurable #1872

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

Kissaki
Copy link
Member

@Kissaki Kissaki commented Nov 2, 2015

Add configuration options for the font of Log, Input and Tree.

Before to after:

Before After
Screenshot of UI before change screenshot of UI after change

Fixes #1850

@Kissaki Kissaki assigned Kissaki and unassigned Kissaki Nov 2, 2015
@Kissaki
Copy link
Member Author

Kissaki commented Nov 2, 2015

The mentioned issue is solved with the recent commit.

Various sizes in use:
various-font-sizes

@Kissaki
Copy link
Member Author

Kissaki commented Nov 2, 2015

I do not know where previously our default font came from.
Now the default, empty QFont gives a different default.
This default, for me on Win7x64, is smaller - too small; MS Shell Dlg2 8pt.

Anyone has an idea where the previous default came from?

QApplication maintains a system/theme font which serves as a default for all widgets.

I guess the default fonts in set in the constructor Settings::Settings should be determined by MainWindow.font().
Not sure about initialization order though. It seems g.mw is not set correctly on initial Settings construction.

@mkrautz
Copy link
Contributor

mkrautz commented Nov 26, 2015

Seems fine to me, but:

  • I think having to select both the font and the size seems a little heavyweight. I had initially thought this would only change the font size. But I guess it's not easy to decouple.
  • We need to figure out what the default font for the log is.
    I suppose we could query it via the application's stylesheet somehow?

@bendem
Copy link
Contributor

bendem commented Nov 28, 2015

This patch works as expected. It's kinda weird that the timestamps are not affected by the selected font size for the logs tho.

Also, UI wise, I'd put the Change All before the 3 separate ones. People will generally want to keep these options in sync and by the time they get to that button, they'll already have changed the 3 settings.

@Krzmbrzl
Copy link
Member

@Kissaki what's the status on this PR? The last comment appears to be indicating that everything is working as expected. Why hasn't this been merged?

@Kissaki
Copy link
Member Author

Kissaki commented Jan 26, 2020

@Krzmbrzl I can only tell you what I see here. It looks like it has not been reviewed, and the comment by mkrautz raised questions which are not answered (who also assigned me again).

bendem added some more suggestions which have not been applied or answered.

Does that answer your question? It has not been merged because nobody merged it.

@Krzmbrzl
Copy link
Member

Alright then let's get this thing rounded up so we can merge it :)

For the default font I'd use the approach suggested in https://stackoverflow.com/questions/11011238/how-do-you-get-system-default-font-settings-in-qt#12179548
That way I think we also don't have to care about initialization order of the MainWindow and the settings.

I think having to select both the font and the size seems a little heavyweight

I think this is great. It allows for more flexibility. And if the user only wants to change the font size, I assume this is easily possible, isn't it?

It's kinda weird that the timestamps are not affected by the selected font size for the logs tho.

I think this should indeed be addressed (if it is still the case)

I'd put the Change All before the 3 separate ones. People will generally want to keep these options in sync and by the time they get to that button, they'll already have changed the 3 settings.

Fair point. I think we don't lose anything by doing this and it'd have the mentioned advantage.

I'll add my actual code review in the next couple of days (if I should forget it, please remind me) :)

updateFontInfo(s);
}

void LookConfig::updateFontInfo(const Settings &r) {
Copy link
Member

Choose a reason for hiding this comment

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

I think r is a bad choice for a variable representing a setting. I'd also prefer a more verbose name. Something like settings I think would be ideal.

}

void LookConfig::updateFontInfo() {
updateFontInfo(s);
Copy link
Member

Choose a reason for hiding this comment

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

What's s? I think there should be a comment here explaining what this call is supposed to do

@@ -171,6 +187,8 @@ void LookConfig::load(const Settings &r) {
}
}

updateFontInfo(r);
Copy link
Member

Choose a reason for hiding this comment

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

What is this doing? It appears somewhat lonely in the code, so I think there should be a comment

@@ -261,3 +279,39 @@ void LookConfig::themeDirectoryChanged() {
reloadThemes(themeData.value<ThemeInfo::StyleInfo>());
}
}

void LookConfig::changeFont(QFont & font) {
Copy link
Member

Choose a reason for hiding this comment

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

Just a style-thing: There's an additional blank after the &

Comment on lines 58 to 66
void updateFontInfo(QLabel *l, const QFont &f);
void updateFontInfo();
void updateFontInfo(const Settings &r);
void changeFont(QFont & font);
protected slots:
void on_qpbFontLog_clicked();
void on_qpbFontInput_clicked();
void on_qpbFontTree_clicked();
void on_qpbFontAll_clicked();
Copy link
Member

Choose a reason for hiding this comment

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

Missing documentation. A function header (Doxygen) explaining what these functions are intended for and what the parameters are for would be nice

Comment on lines +261 to +320
QFont qfFontLog;
QFont qfFontInput;
QFont qfFontTree;
Copy link
Member

Choose a reason for hiding this comment

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

Documentation: A small Doxygen comment stating what these fonts are intended to be used for would improve readability

Implement mumble-voip#1850

Add configuration options for the font of Log, Input and Tree.
Self user and channel, as well as linked channels have adjusted font
properties. Up to now this was based on the main window font.
Now it correctly uses the configured font.
@FireZtreaM
Copy link

Is there any updates on this? Still want this feature!

@Krzmbrzl
Copy link
Member

Nope - if there was any activity on this, it'd be here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Font-size configurable
5 participants