mirror of
https://github.com/labwc/labwc.git
synced 2026-02-18 22:05:32 -05:00
Add screen magnifier
This adds a screen magnifier which can be controlled with the `ZoomIn` / `ZoomOut` and `ToggleMagnify` actions. It scales up part of the rendered framebuffer so the magnification may end up looking blurry depending on the magnification scale. PR #1774
This commit is contained in:
parent
ad15c0474d
commit
8ba066a1a5
13 changed files with 473 additions and 1 deletions
16
src/action.c
16
src/action.c
|
|
@ -15,6 +15,7 @@
|
|||
#include "common/string-helpers.h"
|
||||
#include "debug.h"
|
||||
#include "labwc.h"
|
||||
#include "magnifier.h"
|
||||
#include "menu/menu.h"
|
||||
#include "osd.h"
|
||||
#include "output-virtual.h"
|
||||
|
|
@ -110,6 +111,9 @@ enum action_type {
|
|||
ACTION_TYPE_SHADE,
|
||||
ACTION_TYPE_UNSHADE,
|
||||
ACTION_TYPE_TOGGLE_SHADE,
|
||||
ACTION_TYPE_TOGGLE_MAGNIFY,
|
||||
ACTION_TYPE_ZOOM_IN,
|
||||
ACTION_TYPE_ZOOM_OUT
|
||||
};
|
||||
|
||||
const char *action_names[] = {
|
||||
|
|
@ -163,6 +167,9 @@ const char *action_names[] = {
|
|||
"Shade",
|
||||
"Unshade",
|
||||
"ToggleShade",
|
||||
"ToggleMagnify",
|
||||
"ZoomIn",
|
||||
"ZoomOut",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -1046,6 +1053,15 @@ actions_run(struct view *activator, struct server *server,
|
|||
view_set_shade(view, false);
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_TOGGLE_MAGNIFY:
|
||||
magnify_toggle(server);
|
||||
break;
|
||||
case ACTION_TYPE_ZOOM_IN:
|
||||
magnify_set_scale(server, MAGNIFY_INCREASE);
|
||||
break;
|
||||
case ACTION_TYPE_ZOOM_OUT:
|
||||
magnify_set_scale(server, MAGNIFY_DECREASE);
|
||||
break;
|
||||
case ACTION_TYPE_INVALID:
|
||||
wlr_log(WLR_ERROR, "Not executing unknown action");
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue