mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
output: scale sdd and menu
This commit is contained in:
parent
2061c6af14
commit
6737aeabcd
1 changed files with 10 additions and 0 deletions
10
src/output.c
10
src/output.c
|
|
@ -459,6 +459,7 @@ render_deco(struct view *view, struct output *output,
|
||||||
};
|
};
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
struct wlr_box box = deco_box(view, border[i]);
|
struct wlr_box box = deco_box(view, border[i]);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_rect(output, output_damage, &box, color);
|
render_rect(output, output_damage, &box, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -470,12 +471,14 @@ render_deco(struct view *view, struct output *output,
|
||||||
color = theme->window_inactive_title_bg_color;
|
color = theme->window_inactive_title_bg_color;
|
||||||
}
|
}
|
||||||
struct wlr_box box = deco_box(view, LAB_DECO_PART_TITLE);
|
struct wlr_box box = deco_box(view, LAB_DECO_PART_TITLE);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_rect(output, output_damage, &box, color);
|
render_rect(output, output_damage, &box, color);
|
||||||
|
|
||||||
/* button background */
|
/* button background */
|
||||||
struct wlr_cursor *cur = view->server->seat.cursor;
|
struct wlr_cursor *cur = view->server->seat.cursor;
|
||||||
enum deco_part deco_part = deco_at(view, cur->x, cur->y);
|
enum deco_part deco_part = deco_at(view, cur->x, cur->y);
|
||||||
box = deco_box(view, deco_part);
|
box = deco_box(view, deco_part);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
if (isbutton(deco_part) &&
|
if (isbutton(deco_part) &&
|
||||||
wlr_box_contains_point(&box, cur->x, cur->y)) {
|
wlr_box_contains_point(&box, cur->x, cur->y)) {
|
||||||
color = (float[4]){ 0.5, 0.5, 0.5, 0.5 };
|
color = (float[4]){ 0.5, 0.5, 0.5, 0.5 };
|
||||||
|
|
@ -485,22 +488,28 @@ render_deco(struct view *view, struct output *output,
|
||||||
/* buttons */
|
/* buttons */
|
||||||
if (view->surface == seat->keyboard_state.focused_surface) {
|
if (view->surface == seat->keyboard_state.focused_surface) {
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_CLOSE);
|
box = deco_box(view, LAB_DECO_BUTTON_CLOSE);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_close_active_unpressed);
|
theme->xbm_close_active_unpressed);
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_MAXIMIZE);
|
box = deco_box(view, LAB_DECO_BUTTON_MAXIMIZE);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_maximize_active_unpressed);
|
theme->xbm_maximize_active_unpressed);
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_ICONIFY);
|
box = deco_box(view, LAB_DECO_BUTTON_ICONIFY);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_iconify_active_unpressed);
|
theme->xbm_iconify_active_unpressed);
|
||||||
} else {
|
} else {
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_CLOSE);
|
box = deco_box(view, LAB_DECO_BUTTON_CLOSE);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_close_inactive_unpressed);
|
theme->xbm_close_inactive_unpressed);
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_MAXIMIZE);
|
box = deco_box(view, LAB_DECO_BUTTON_MAXIMIZE);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_maximize_inactive_unpressed);
|
theme->xbm_maximize_inactive_unpressed);
|
||||||
box = deco_box(view, LAB_DECO_BUTTON_ICONIFY);
|
box = deco_box(view, LAB_DECO_BUTTON_ICONIFY);
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
render_icon(output, output_damage, &box,
|
render_icon(output, output_damage, &box,
|
||||||
theme->xbm_iconify_inactive_unpressed);
|
theme->xbm_iconify_inactive_unpressed);
|
||||||
}
|
}
|
||||||
|
|
@ -527,6 +536,7 @@ render_rootmenu(struct output *output, pixman_region32_t *output_damage)
|
||||||
.width = menuitem->geo_box.width,
|
.width = menuitem->geo_box.width,
|
||||||
.height = menuitem->geo_box.height,
|
.height = menuitem->geo_box.height,
|
||||||
};
|
};
|
||||||
|
scale_box(&box, output->wlr_output->scale);
|
||||||
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL,
|
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL,
|
||||||
0, output->wlr_output->transform_matrix);
|
0, output->wlr_output->transform_matrix);
|
||||||
render_texture(output->wlr_output, output_damage, t,
|
render_texture(output->wlr_output, output_damage, t,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue