Skip to content

Remove offset on username field in classic theme#5788

Merged
droidmonkey merged 1 commit intorelease/2.6.3from
hotfix/classic-theme
Dec 20, 2020
Merged

Remove offset on username field in classic theme#5788
droidmonkey merged 1 commit intorelease/2.6.3from
hotfix/classic-theme

Conversation

@droidmonkey
Copy link
Copy Markdown
Member

@droidmonkey droidmonkey commented Dec 8, 2020

Screenshots

Classic Theme:
image

Testing strategy

Tested on Windows

Type of change

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

@droidmonkey droidmonkey added this to the v2.6.3 milestone Dec 8, 2020
@droidmonkey droidmonkey requested a review from phoerious December 8, 2020 02:52
@phoerious
Copy link
Copy Markdown
Member

phoerious commented Dec 9, 2020

Scrap all that. I found a much cleaner solution that doesn't need any style sheets in widgets where they don't belong:

diff --git a/src/gui/styles/base/BaseStyle.cpp b/src/gui/styles/base/BaseStyle.cpp
index 6cde175c..db2897ab 100644
--- a/src/gui/styles/base/BaseStyle.cpp
+++ b/src/gui/styles/base/BaseStyle.cpp
@@ -4777,7 +4777,11 @@ QRect BaseStyle::subElementRect(SubElement sr, const QStyleOption* opt, const QW
     }
     case SE_LineEditContents: {
         QRect r = QCommonStyle::subElementRect(sr, opt, w);
-        int pad = Phantom::dpiScaled(Phantom::LineEdit_ContentsHPad);
+        int pad = Phantom::LineEdit_ContentsHPad;
+        if (w && qobject_cast<const QComboBox*>(w->parentWidget())) {
+            pad += 3;
+        }
+        pad = Phantom::dpiScaled(pad);
         return r.adjusted(pad, 0, -pad, 0);
     }
     default:

@randrew Not sure if that applies to your plain PhantomStyle as well, but you may want to have a look.

@phoerious
Copy link
Copy Markdown
Member

I pushed it as a new commit, feel free to fix it up with the removal of the style sheets.

@phoerious phoerious force-pushed the hotfix/classic-theme branch from 581add3 to a9f3e49 Compare December 9, 2020 11:56
@randrew
Copy link
Copy Markdown

randrew commented Dec 9, 2020

@phoerious Is there some particular setup I need to reproduce this in a test GUI? I don't see it with a standard line edit.

@droidmonkey
Copy link
Copy Markdown
Member Author

@randrew this is comparing a QLineEdit with a QComboBox (which has a QLineEdit embedded in it). Unfortunately QComboBox doesn't let you style the internal QLineEdit and the left-padding is different between the two.

@randrew
Copy link
Copy Markdown

randrew commented Dec 9, 2020

Oh, this is something I never tried in the PhantomStyle funhouse. Thanks for pointing it out. I'll add it to to the funhouse and probably end up adding a similar fix for PhantomStyle itself.

* Fix #5601

Fix padding offset in editable QComboBox

Accepted
@droidmonkey
Copy link
Copy Markdown
Member Author

I implemented your change @phoerious and also added 2 px stylesheet padding to QLineEdit's. Classic mode looks good now!

@phoerious
Copy link
Copy Markdown
Member

I'll have to test if the 2px work well on Linux, too. What I certainly do notice on Windows at least is that the QComboBox has a different height. But that is not something that was touched here.

@droidmonkey droidmonkey linked an issue Dec 19, 2020 that may be closed by this pull request
@droidmonkey droidmonkey merged commit f9b2cf8 into release/2.6.3 Dec 20, 2020
@droidmonkey droidmonkey deleted the hotfix/classic-theme branch December 20, 2020 18:03
phoerious added a commit that referenced this pull request Jan 12, 2021
Added

- Support Argon2id KDF [#5778]
- Support XMLv2 key files [#5798]

Changed

- Improve CSV Import/Export, include time fields and TOTP [#5346]
- Support empty area dragging of the application window [#5860]
- Display default Auto-Type sequence in preview pane [#5654]
- Remove strict length limit on generated passwords [#5748]
- Hide key file path by default when unlocking database [#5779]
- Document browser extension use with Edge in managed mode [#5692]
- Windows: Prevent clipboard history and cloud sync [#5853]
- macOS: Update the application icon to Big Sur styling [#5851]

Fixed

- Re-select previously selected entry on database unlock [#5559]
- Properly save special character choice in password generator [#5610]
- Fix crash in browser integration with multiple similar entries [#5653]
- Remove offset on username field in classic theme [#5788]
- Ensure entry history is copied when drag/dropping entries and groups [#5817]
- Close modal dialogs when database is locked [#5820]
- Prevent crash when KeeShare modifies an entry that is currently being edited [#5827]
- Improve preview of entry attributes [#5834]
- Always activate/focus database open dialog preventing mistype [#5878]
- Reports: fix calculation of average password length [#5862]
- Linux: Delay startup on login to correct tray icon issues [#5724]
aswild added a commit to aswild/keepassxc that referenced this pull request Jan 13, 2021
Release 2.6.3

Added

- Support Argon2id KDF [keepassxreboot#5778]
- Support XMLv2 key files [keepassxreboot#5798]

Changed

- Improve CSV Import/Export, include time fields and TOTP [keepassxreboot#5346]
- Support empty area dragging of the application window [keepassxreboot#5860]
- Display default Auto-Type sequence in preview pane [keepassxreboot#5654]
- Remove strict length limit on generated passwords [keepassxreboot#5748]
- Hide key file path by default when unlocking database [keepassxreboot#5779]
- Document browser extension use with Edge in managed mode [keepassxreboot#5692]
- Windows: Prevent clipboard history and cloud sync [keepassxreboot#5853]
- macOS: Update the application icon to Big Sur styling [keepassxreboot#5851]

Fixed

- Re-select previously selected entry on database unlock [keepassxreboot#5559]
- Properly save special character choice in password generator [keepassxreboot#5610]
- Fix crash in browser integration with multiple similar entries [keepassxreboot#5653]
- Remove offset on username field in classic theme [keepassxreboot#5788]
- Ensure entry history is copied when drag/dropping entries and groups [keepassxreboot#5817]
- Close modal dialogs when database is locked [keepassxreboot#5820]
- Prevent crash when KeeShare modifies an entry that is currently being edited [keepassxreboot#5827]
- Improve preview of entry attributes [keepassxreboot#5834]
- Always activate/focus database open dialog preventing mistype [keepassxreboot#5878]
- Reports: fix calculation of average password length [keepassxreboot#5862]
- Linux: Delay startup on login to correct tray icon issues [keepassxreboot#5724]
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.

Username field has an offset when in classic theme

3 participants