mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-15 19:56:55 +00:00
Cleanup remaining dpi scaling of min & max width (#1926)
This was left over from #1877.
This commit is contained in:
parent
682db0c4df
commit
7526e7e18d
@ -858,7 +858,7 @@ void update_text_area() {
|
||||
if (fixed_size == 0)
|
||||
#endif
|
||||
{
|
||||
text_size = conky::vec2i(dpi_scale(minimum_width.get(*state)), 0);
|
||||
text_size = conky::vec2i(minimum_width.get(*state), 0);
|
||||
last_font_height = font_height();
|
||||
for_each_line(text_buffer, text_size_updater);
|
||||
text_size += conky::vec2i::UnitX();
|
||||
@ -984,7 +984,7 @@ static int text_size_updater(char *s, int special_index) {
|
||||
|
||||
if (w > text_size.x()) { text_size.set_x(w); }
|
||||
int mw = maximum_width.get(*state);
|
||||
if (text_size.x() > mw && mw > 0) { text_size.set_x(mw); }
|
||||
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
|
||||
|
||||
text_size += conky::vec2i(0, last_font_height);
|
||||
last_font_height = font_height();
|
||||
|
@ -661,8 +661,8 @@ bool display_output_wayland::main_loop_wait(double t) {
|
||||
text_size.y() + 2 * border_total != height || scale_changed)) {
|
||||
/* clamp text_width to configured maximum */
|
||||
if (maximum_width.get(*state)) {
|
||||
int mw = global_window->scale * maximum_width.get(*state);
|
||||
if (text_size.x() > mw && mw > 0) { text_size.set_x(mw); }
|
||||
int mw = maximum_width.get(*state);
|
||||
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
|
||||
}
|
||||
|
||||
/* pending scale will be applied by resizing the window */
|
||||
|
@ -666,7 +666,7 @@ bool handle_event<x_event_handler::CONFIGURE>(
|
||||
|
||||
// don't apply dpi scaling to max pixel size
|
||||
int mw = maximum_width.get(*state);
|
||||
if (text_size.x() > mw && mw > 0) { text_size.set_x(mw); }
|
||||
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
|
||||
}
|
||||
|
||||
/* if position isn't what expected, set fixed pos
|
||||
|
Loading…
Reference in New Issue
Block a user