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

Layoutbox rendering is blurry on HiDPI screen #3790

Merged
merged 4 commits into from
May 16, 2023

Conversation

mireq
Copy link
Contributor

@mireq mireq commented Mar 26, 2023

I think, layoutbox should not render icons directly. On HiDPI screens, svg files rendered this way are always in base resoltuion, which looks blurry. Method :set_image() should be called instead.

Few possible modifications:

Silent loading (surface.load_silently) could be dropped and if "layout_" .. name is set, image can be loaded directly. If it's not set, user will see just text representation. If path to image is not valid, i think, it's ok to display error message.

local image_name = "layout_" .. name
local theme_image = beautiful[image_name]
local success = false
if theme_image ~= nil then
    success = w.imagebox:set_image(beautiful[image_name])
end
w.textbox.text = success and "" or name

Or imagebox could have interface for silent loading.

layotubox_sharp

@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #3790 (b642166) into master (b54e50a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3790   +/-   ##
=======================================
  Coverage   90.99%   91.00%           
=======================================
  Files         900      900           
  Lines       57502    57505    +3     
=======================================
+ Hits        52326    52330    +4     
+ Misses       5176     5175    -1     
Flag Coverage Δ
gcov 91.00% <100.00%> (+<0.01%) ⬆️
luacov 93.71% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/awful/widget/layoutbox.lua 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

Aire-One
Aire-One previously approved these changes Apr 7, 2023
Copy link
Member

@Aire-One Aire-One left a comment

Choose a reason for hiding this comment

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

Sorry for the late replies on your PRs.

I have this idea to move all the awful.widget.* widgets to template, so that the user can define the consumer widget with whatever they want.

Regardless, this fix is more than welcome! And I don't think it would clash with my targets, since we need to preserve a default widget that is backward compatible with the current usage.

So it's all good to me. Thank you!

Elv13
Elv13 previously approved these changes Apr 23, 2023
@Elv13
Copy link
Member

Elv13 commented Apr 23, 2023

Sorry for my even longer delay before taking a look at this. It looks good, but to be merged the CI warning needs to be fixed:

Checking lib/awful/widget/launcher.lua            OK
Checking lib/awful/widget/layoutbox.lua           1 warning

    lib/awful/widget/layoutbox.lua:18:7: unused variable 'surface'

@mireq mireq dismissed stale reviews from Elv13 and Aire-One via b642166 May 13, 2023 05:22
Copy link
Member

@actionless actionless left a comment

Choose a reason for hiding this comment

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

thanks!

@Aire-One
Copy link
Member

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented May 16, 2023

refresh

✅ Pull request refreshed

@mergify mergify bot merged commit b13ac3e into awesomeWM:master May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants