From af5d6b683f1ac01ed5e957d2d2d8f3b4a3d72b64 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 8 Jun 2017 17:09:47 +0200 Subject: [PATCH 1/2] DPIfy all themes (mostly zenburn) This makes sure that all sizes that are specified in themes go through the dpi() function. For most themes this just means that the value 0 is DPIfied, which should not make much of a difference. However, for zenburn this actually adds the very first calls to dpi() to this theme. Fixes: https://github.com/awesomeWM/awesome/issues/1807 Signed-off-by: Uli Schlachter --- themes/default/theme.lua | 2 +- themes/sky/theme.lua | 2 +- themes/zenburn/theme.lua | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/themes/default/theme.lua b/themes/default/theme.lua index 0a6b1792..b0be4801 100644 --- a/themes/default/theme.lua +++ b/themes/default/theme.lua @@ -24,7 +24,7 @@ theme.fg_focus = "#ffffff" theme.fg_urgent = "#ffffff" theme.fg_minimize = "#ffffff" -theme.useless_gap = 0 +theme.useless_gap = dpi(0) theme.border_width = dpi(1) theme.border_normal = "#000000" theme.border_focus = "#535d6c" diff --git a/themes/sky/theme.lua b/themes/sky/theme.lua index c7d53176..0aa7d1bd 100644 --- a/themes/sky/theme.lua +++ b/themes/sky/theme.lua @@ -25,7 +25,7 @@ theme.fg_focus = "#2e3436" theme.fg_urgent = "#2e3436" theme.fg_minimize = "#2e3436" -theme.useless_gap = 0 +theme.useless_gap = dpi(0) theme.border_width = dpi(2) theme.border_normal = "#dae3e0" theme.border_focus = "#729fcf" diff --git a/themes/zenburn/theme.lua b/themes/zenburn/theme.lua index af10fae6..2b6fa08a 100644 --- a/themes/zenburn/theme.lua +++ b/themes/zenburn/theme.lua @@ -4,6 +4,7 @@ ------------------------------- local themes_path = require("gears.filesystem").get_themes_dir() +local dpi = require("beautiful.xresources").apply_dpi -- {{{ Main local theme = {} @@ -24,8 +25,8 @@ theme.bg_systray = theme.bg_normal -- }}} -- {{{ Borders -theme.useless_gap = 0 -theme.border_width = 2 +theme.useless_gap = dpi(0) +theme.border_width = dpi(2) theme.border_normal = "#3F3F3F" theme.border_focus = "#6F6F6F" theme.border_marked = "#CC9393" @@ -66,8 +67,8 @@ theme.mouse_finder_color = "#CC9393" -- Variables set for theming the menu: -- menu_[bg|fg]_[normal|focus] -- menu_[border_color|border_width] -theme.menu_height = 15 -theme.menu_width = 100 +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) -- }}} -- {{{ Icons From 9b991fb40b403c0a538d40eb4ce33a8c5f434b5d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 8 Jun 2017 17:12:15 +0200 Subject: [PATCH 2/2] awful.menu: DPIfy the default menu size Related-to: https://github.com/awesomeWM/awesome/issues/1807 Signed-off-by: Uli Schlachter --- lib/awful/menu.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/awful/menu.lua b/lib/awful/menu.lua index 0635e7c5..42440e94 100644 --- a/lib/awful/menu.lua +++ b/lib/awful/menu.lua @@ -116,7 +116,7 @@ local function load_theme(a, b) ret.border = a.border_color or b.menu_border_color or b.border_normal or fallback.menu_border_color or fallback.border_normal ret.border_width= a.border_width or b.menu_border_width or b.border_width or - fallback.menu_border_width or fallback.border_width or 0 + fallback.menu_border_width or fallback.border_width or dpi(0) ret.fg_focus = a.fg_focus or b.menu_fg_focus or b.fg_focus or fallback.menu_fg_focus or fallback.fg_focus ret.bg_focus = a.bg_focus or b.menu_bg_focus or b.bg_focus or @@ -130,9 +130,9 @@ local function load_theme(a, b) ret.submenu = a.submenu or b.menu_submenu or b.submenu or fallback.menu_submenu or fallback.submenu or "▶" ret.height = a.height or b.menu_height or b.height or - fallback.menu_height or 16 + fallback.menu_height or dpi(16) ret.width = a.width or b.menu_width or b.width or - fallback.menu_width or 100 + fallback.menu_width or dpi(100) ret.font = a.font or b.font or fallback.font for _, prop in ipairs({"width", "height", "menu_width"}) do if type(ret[prop]) ~= "number" then ret[prop] = tonumber(ret[prop]) end