mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
squash! [wip] Add ToggleShade
ssd: draw resize indicator with regard to view shading
This commit is contained in:
parent
baf3d60752
commit
0377772c5d
1 changed files with 4 additions and 2 deletions
|
|
@ -159,6 +159,8 @@ resize_indicator_update(struct view *view)
|
||||||
|
|
||||||
char text[32]; /* 12345 x 12345 would be 13 chars + 1 null byte */
|
char text[32]; /* 12345 x 12345 would be 13 chars + 1 null byte */
|
||||||
|
|
||||||
|
int eff_height = view_effective_height(view, false);
|
||||||
|
|
||||||
switch (view->server->input_mode) {
|
switch (view->server->input_mode) {
|
||||||
case LAB_INPUT_STATE_RESIZE:
|
case LAB_INPUT_STATE_RESIZE:
|
||||||
; /* works around "a label can only be part of a statement" */
|
; /* works around "a label can only be part of a statement" */
|
||||||
|
|
@ -166,7 +168,7 @@ resize_indicator_update(struct view *view)
|
||||||
snprintf(text, sizeof(text), "%d x %d",
|
snprintf(text, sizeof(text), "%d x %d",
|
||||||
MAX(0, view->current.width - hints.base_width)
|
MAX(0, view->current.width - hints.base_width)
|
||||||
/ MAX(1, hints.width_inc),
|
/ MAX(1, hints.width_inc),
|
||||||
MAX(0, view->current.height - hints.base_height)
|
MAX(0, eff_height - hints.base_height)
|
||||||
/ MAX(1, hints.height_inc));
|
/ MAX(1, hints.height_inc));
|
||||||
break;
|
break;
|
||||||
case LAB_INPUT_STATE_MOVE:
|
case LAB_INPUT_STATE_MOVE:
|
||||||
|
|
@ -193,7 +195,7 @@ resize_indicator_update(struct view *view)
|
||||||
/* Center the indicator in the window */
|
/* Center the indicator in the window */
|
||||||
wlr_scene_node_set_position(&indicator->tree->node,
|
wlr_scene_node_set_position(&indicator->tree->node,
|
||||||
(view->current.width - indicator->width) / 2,
|
(view->current.width - indicator->width) / 2,
|
||||||
(view->current.height - indicator->height) / 2);
|
(eff_height - indicator->height) / 2);
|
||||||
|
|
||||||
scaled_font_buffer_update(indicator->text, text, width, &rc.font_osd,
|
scaled_font_buffer_update(indicator->text, text, width, &rc.font_osd,
|
||||||
rc.theme->osd_label_text_color, NULL /* const char *arrow */);
|
rc.theme->osd_label_text_color, NULL /* const char *arrow */);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue