Skip to content

Several ui fixes #11967

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

xboxones1
Copy link
Contributor

@xboxones1 xboxones1 commented Mar 31, 2025

  1. Fixes Background color when setting the shortcut for auto-type #11757
  2. Fixes Irregular alignment of options in Settings - General - tab Autofill #11749
  3. Fix contrast for splitter handle
  4. Fixes Font size is reset after switching theme #11983
  5. Clean up after 6084b69

Screenshots

1
2
3
1
2

Testing strategy

Manual

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@xboxones1 xboxones1 changed the title Fix background color error for invalid autotype shortcut Several ui fixes Apr 13, 2025
@droidmonkey
Copy link
Member

Can you add the font size reset on theme change fix?

@xboxones1
Copy link
Contributor Author

@droidmonkey,

connect(themeActions, &QActionGroup::triggered, this, [this, theme](QAction* action) {
config()->set(Config::GUI_ApplicationTheme, action->data());
if ((action->data() == "classic" || theme == "classic") && action->data() != theme) {
restartApp(tr("You must restart the application to apply this setting. Would you like to restart now?"));
} else {
kpxcApp->applyTheme();
}

I think that it can be fixed like this

    connect(themeActions, &QActionGroup::triggered, this, [this, theme](QAction* action) {
        config()->set(Config::GUI_ApplicationTheme, action->data());
        if ((action->data() == "classic" || theme == "classic") && action->data() != theme) {
            restartApp(tr("You must restart the application to apply this setting. Would you like to restart now?"));
        } else {
            kpxcApp->applyTheme();
            kpxcApp->applyFontSize();
        }

@xboxones1 xboxones1 force-pushed the fix/color-shortcut-autotype branch from 56ca23e to 7d7476d Compare May 15, 2025 08:07
@droidmonkey droidmonkey added this to the v2.7.11 milestone May 18, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes UI styling fixes by migrating splitter handle colors into code, refines various widget styles, and ensures dynamic font sizing with theme changes.

  • Migrate splitter handle styling from dark QSS into BaseStyle code and fix its contrast.
  • Update error highlighting in ApplicationSettingsWidget to use StateColorPalette, align a settings label, and remove an obsolete tab stop.
  • Apply font size changes immediately when the theme is toggled in MainWindow.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/gui/styles/dark/darkstyle.qss Removed QSplitterHandle rule as splitter styling is now handled in code
src/gui/styles/base/BaseStyle.cpp Added S_splitterHandle color entry and updated drawControl splitter logic
src/gui/dbsettings/DatabaseSettingsWidgetEncryption.ui Removed advancedSettingsButton from the tab order
src/gui/MainWindow.cpp Invoke applyFontSize() after theme application
src/gui/ApplicationSettingsWidgetGeneral.ui Right-align "Remember last typed entry for:" label
src/gui/ApplicationSettingsWidget.cpp Replace hardcoded error CSS with StateColorPalette for shortcut widget
Comments suppressed due to low confidence (2)

src/gui/styles/dark/darkstyle.qss:32

  • [nitpick] With splitter styling now in code, consider adding a comment or consolidating other QSS selectors (e.g., QSplitter::handle) to clarify where and how splitter handles are styled.
QSplitterHandle {

src/gui/MainWindow.cpp:1997

  • [nitpick] Consider adding a unit or integration test to verify that font size changes are applied correctly when the view menu setting is toggled.
kpxcApp->applyFontSize();

painter->fillRect(filledRect, swatch.color(S_button_specular));
Ph::fillRectOutline(painter, filledRect.adjusted(-1, 0, 1, 0), 1, swatch.color(S_window_divider));
painter->fillRect(filledRect, swatch.color(S_splitterHandle));
Ph::fillRectOutline(painter, filledRect.adjusted(-1, -1, 1, 1), 1, swatch.color(S_splitterHandle));
Copy link
Preview

Copilot AI May 18, 2025

Choose a reason for hiding this comment

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

Outline is drawn with the same S_splitterHandle color, making the border invisible. Consider using a contrasting color (e.g., S_window_divider) for the outline to improve visibility.

Suggested change
Ph::fillRectOutline(painter, filledRect.adjusted(-1, -1, 1, 1), 1, swatch.color(S_splitterHandle));
Ph::fillRectOutline(painter, filledRect.adjusted(-1, -1, 1, 1), 1, swatch.color(S_window_divider));

Copilot uses AI. Check for mistakes.

m_generalUi->autoTypeShortcutWidget->setStyleSheet("background-color: #FF9696;");
StateColorPalette statePalette;
auto color = statePalette.color(StateColorPalette::ColorRole::Error);
m_generalUi->autoTypeShortcutWidget->setStyleSheet(QString("QLineEdit { background: %1; }").arg(color.name()));
Copy link
Preview

Copilot AI May 18, 2025

Choose a reason for hiding this comment

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

[nitpick] Use the background-color property in the style sheet rather than the background shorthand for clarity, e.g., QLineEdit { background-color: %1; }.

Suggested change
m_generalUi->autoTypeShortcutWidget->setStyleSheet(QString("QLineEdit { background: %1; }").arg(color.name()));
m_generalUi->autoTypeShortcutWidget->setStyleSheet(QString("QLineEdit { background-color: %1; }").arg(color.name()));

Copilot uses AI. Check for mistakes.

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