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
Appearance tab. Issue #6363. #6375
Conversation
--HG-- branch : magao-dev
@magao, thank for posting the code! Frankly speaking, I don't like the result of our plan (#6363 (comment)) because it results in overconcentration of responsibilities in the |
I'll have to think about this some more (just woke up, no caffeine yet ...). The advantage of having the But we could easily have a mixture of the 2 - a separate And palette changes would be forwarded to the I don't think we should move the actual preference accessors to it - I think leaving them on |
Can not agree with you, sorry. Changes in the environment are not changes in the application preferences. And there is another point which needs to be raised here: the project tries to move away from concentrating everything in the And that is why I proposed to change our roadmap a bit and settle these components before implementing all their future stuff, but not moving it into them later. Thus I propose you to limit this PR within options consolidation in the new options page. |
09a06c4
to
e96078f
Compare
@evsh Done. Please set up the code how you want it with the default theme, and once that's merged I'll port my icon fixes (inverting, coloured to match state) and dark/light theme detection on top of the default theme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I did not write these remarks last time.
src/base/preferences.cpp
Outdated
{ "Preferences/Advanced/useSystemIconTheme", "Preferences/Appearance/useSystemIconTheme" }, | ||
}; | ||
|
||
for (QList<QPair<QString, QString>>::iterator iter = prefsToMigrate.begin(); iter != prefsToMigrate.end(); ++iter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write:
for (auto iter = prefsToMigrate.begin(); iter != prefsToMigrate.end(); ++iter) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to that (auto
is another C++11 thing I wasn't aware of).
@@ -1611,10 +1642,9 @@ void Preferences::upgrade() | |||
QStringList labels = value("TransferListFilters/customLabels").toStringList(); | |||
if (!labels.isEmpty()) { | |||
QVariantMap categories = value("BitTorrent/Session/Categories").toMap(); | |||
foreach (const QString &label, labels) { | |||
foreach (const QString &label, labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const QString &label: labels)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was from uncrustify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I meant that one can use range-based for here too, instead of Qt's foreach macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - but my point is that this an automated change in the code cleanup commit - it's not part of the changes for the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/gui/optionsdlg.cpp
Outdated
@@ -77,13 +77,14 @@ OptionsDialog::OptionsDialog(QWidget *parent) | |||
setModal(true); | |||
|
|||
// Icons | |||
m_ui->tabSelection->item(TAB_UI)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop")); | |||
m_ui->tabSelection->item(TAB_APPEARANCE)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop")); | |||
m_ui->tabSelection->item(TAB_BEHAVIOUR)->setIcon(GuiIconProvider::instance()->getIcon("gear")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icon name has to be FDO compatible. "preferences-desktop-theme" seems to be suitable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change the names of any of the icons - just used what was already there.
What is FDO? I don't think you mean Feedback-Directed Optimization - I'm guessing it's something to do with FreeDesktop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FDO stands for FreeDesktop.org, and here is the icon theme specification. You may also look at QIcon::fromTheme()
documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to leave doing any of this to someone who knows something about it e.g. you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll change icon names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll change icon names
No, there will be a problem then at merging. Could you, please, copy the icon "gear" into "preferences-desktop-theme" and change this call to:
m_ui->tabSelection->item(TAB_BEHAVIOUR)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop-theme"));
or, if you do not want to copy the icon:
m_ui->tabSelection->item(TAB_BEHAVIOUR)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop-theme", "gear"));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, no! The icon "preferences-desktop-theme" is for the "Appearance" tab. "preferences-desktop" should be used for the "Behaviour" tab as it is now. Things get complicated :) If you like, leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no preferences-desktop-theme.png
in the existing codebase. I didn't change any icon names - just moved around the ones that were already being used since we didn't have an icon for the Appearance tab.
I will revert them all (and not have an icon for Appearance) and you can do whatever you want to.
src/gui/optionsdlg.cpp
Outdated
m_ui->tabSelection->item(TAB_BITTORRENT)->setIcon(GuiIconProvider::instance()->getIcon("preferences-system-network")); | ||
m_ui->tabSelection->item(TAB_CONNECTION)->setIcon(GuiIconProvider::instance()->getIcon("network-wired")); | ||
m_ui->tabSelection->item(TAB_DOWNLOADS)->setIcon(GuiIconProvider::instance()->getIcon("folder-download")); | ||
m_ui->tabSelection->item(TAB_SPEED)->setIcon(GuiIconProvider::instance()->getIcon("speedometer", "chronometer")); | ||
#ifndef DISABLE_WEBUI | ||
m_ui->tabSelection->item(TAB_WEBUI)->setIcon(GuiIconProvider::instance()->getIcon("network-server")); | ||
m_ui->tabSelection->item(TAB_WEBUI)->setIcon(GuiIconProvider::instance()->getIcon("webui")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: "network-server" is the name which is found in almost any icon theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this change, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you may do:
GuiIconProvider::instance()->getIcon("network-server", "webui")
@magao thank you. I will play my round on top of this. |
@evsh I'll address the review comments this weekend. I didn't want to change any icon names, etc in this commit - just wanted the minimal changes to get the Appearance tab. Maybe I shouldn't have changed the WebUI icon. I'm happy for you to reorganise as you think best - the only investment I have in this is that I want to get the changes from my other PR implemented ... |
@magao, you forgot to remove |
--HG-- branch : magao-dev
e96078f
to
8d8f4a4
Compare
@evsh Minimal version pushed - addressed comments, reverted all icon changes. |
@LordNyriox, stop your flooding already, please. |
@magao are you still interested in this? If yes, please rebase. |
@magao are you still interested in this? |
Don't really care. If someone else wants to take the code and create a new PR feel free to do so. |
Moves existing options to a new "Appearance tab" as discussed in issue #6363.
Changed preferences icons:
Existing Behaviour icon moved to Appearance.
Behaviour now has the gear icon.
WebUI icon changed to
qbt-theme/webui.png
(which I think it was probably intended to be).2 new signals emitted from
Preferences
when theme-related options are changed or dark/light theme change detected:Preferences::configureThemeProvider()
emitted first, theme providers (e.g.GuiIconProvider
) need to connect directly to ensure they are configured before being used;Preferences::themeChanged()
for components that need to update themselves when a theme change occurs.Both of these signals are emitted before
Preferences::changed()
.