-
Notifications
You must be signed in to change notification settings - Fork 87
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
feature: High-quality dictionary icons in toolbar #1750
feature: High-quality dictionary icons in toolbar #1750
Conversation
src/ui/dictionarybar.cc
Outdated
@@ -72,7 +72,7 @@ void DictionaryBar::setDictionaries( vector< sptr< Dictionary::Class > > const & | |||
dictActions.append( action ); | |||
} | |||
|
|||
setDictionaryIconSize( 21 ); | |||
setDictionaryIconSize( 200 ); |
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 entire method of DictionaryBar::setDictionaryIconSize
should be just deleted because the height of QToolBar is set automatically. Especially on Linux, it can be any value depends on what theme the user is using. The value 21
was set a decade ago for no reason.
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 removed it as you said, but it seems that more files have references to that method, for instance of one these files is " scanpopup.cc"
src/dict/dictionary.cc
Outdated
dictionaryIcon = QIcon( QPixmap::fromImage( result ) ); | ||
|
||
return !dictionaryIcon.isNull(); |
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.
dictionaryIcon
have to be set for dictionaries to have icons.
Surprisingly, Change initial value will cause problems to Highly related: #1459 |
#1459 need another day to do. However, I pushed a change to enable a hidden feature that enables the user to set dictionaryBar icon size in qt style sheet.
Note that it will be bound by 64. Edit: this doesn't work for actually implemented version. |
4a1f436
to
7ba344e
Compare
7615199
to
1d7d62b
Compare
can that have an option in the preferences? |
I don't know yet. Need to find free time to implement it first 😅 Can you please double-check my code? Then let's merge this first, and consider an option for larger icons later. |
alright, i'll test on my guix and check the results |
These are the resultsone thing that you can notice is that somehow the icons are too far from each other, it's not a square anymore... |
I think the rectangle icon and pixels effect is caused by none-square initial toolbar icon size? I pushed a fix, does it work? |
if you compare to my first image maybe when choosing the icon size, you can compare the height and width numerically and pick the other that's higher, this way it will avoid downscale, but it can also cause upscaling, but i dont think it's a problem |
Quality Gate failedFailed conditions |
Ok, let's merge this :) |
still blurry but i think it'd require more than one PR to solve this |
Could the reason be high resolution screen? For a 4x density monitor and the toolbar icon's logical size 21, then it would require 21*4=84? |
for example, if you look at this comparison, both are in the same monitor. for some reason when i first removed the value of 21 as we did in the beginning, and set a high value in another variable: somehow the barsize is downscaling the icons? i dont really know |
some of the code added to prevent crashes had a bad side effect, causing the icons to get a bad quality.
two line of codes in two different files were causing that downscaling, the first line was removed, the second had its value changed to a higher value, both conditions were tested and the result is pretty good: