mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
Make magnifier increment a theme parameter
This commit is contained in:
parent
56a86ffeed
commit
a64479037f
4 changed files with 17 additions and 6 deletions
|
|
@ -14,7 +14,7 @@
|
|||
#include "common/macros.h"
|
||||
|
||||
static bool magnify_on;
|
||||
static double mag_scale = 0.0;
|
||||
static double mag_scale = 0.0, mag_increment = 0.0;
|
||||
|
||||
struct wlr_surface *
|
||||
lab_wlr_surface_from_node(struct wlr_scene_node *node)
|
||||
|
|
@ -103,6 +103,9 @@ magnify(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box
|
|||
if (mag_scale == 0.0) {
|
||||
mag_scale = theme->mag_scale;
|
||||
}
|
||||
if (mag_increment == 0.0) {
|
||||
mag_increment = theme->mag_increment;
|
||||
}
|
||||
|
||||
if (fullscreen) {
|
||||
// The lines below were the first attempt at enabling fullscreen (with no
|
||||
|
|
@ -304,17 +307,16 @@ magnify_toggle(void)
|
|||
void
|
||||
magnify_set_scale(enum magnify_dir dir)
|
||||
{
|
||||
#define MAG_INCREMENT 0.2
|
||||
if (dir == MAGNIFY_INCREASE) {
|
||||
if (magnify_on) {
|
||||
mag_scale += MAG_INCREMENT;
|
||||
mag_scale += mag_increment;
|
||||
} else {
|
||||
magnify_on = true;
|
||||
mag_scale = 1.0 + MAG_INCREMENT;
|
||||
mag_scale = 1.0 + mag_increment;
|
||||
}
|
||||
} else {
|
||||
if (magnify_on && mag_scale > 1.0 + MAG_INCREMENT) {
|
||||
mag_scale -= MAG_INCREMENT;
|
||||
if (magnify_on && mag_scale > 1.0 + mag_increment) {
|
||||
mag_scale -= mag_increment;
|
||||
} else {
|
||||
magnify_on = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -579,6 +579,7 @@ theme_builtin(struct theme *theme, struct server *server)
|
|||
parse_hexstr("#ff0000", theme->mag_border_color);
|
||||
theme->mag_border_width = 1;
|
||||
theme->mag_filter = true;
|
||||
theme->mag_increment = 0.2;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -853,6 +854,9 @@ entry(struct theme *theme, const char *key, const char *value)
|
|||
if (match_glob(key, "magnifier.filter")) {
|
||||
theme->mag_filter = atoi(value);
|
||||
}
|
||||
if (match_glob(key, "magnifier.increment")) {
|
||||
theme->mag_increment = atof(value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue