summaryrefslogtreecommitdiffstats
path: root/include/widgets/widget-internal.h
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-01-24 22:20:41 +0100
committerGitHub <noreply@github.com>2022-01-24 22:20:41 +0100
commit6e3feee1799d280e246ea088350a6722f6b2e894 (patch)
treef53697f33efdaed2cb77ebd6cda881bbbf915006 /include/widgets/widget-internal.h
parent33643d0642e5d4228abf0bb19711ada837f6dff5 (diff)
Add support for setting tabs stops on textboxes (#1571)
* Document new array of values type * Move WIDGET_PADDING_INIT from widget.c to widget-internal.h * Refactor WIDGET_PADDING_INIT macro * Add support for setting tab stops on textbox This allows to emulate a multi-column layout inside the text boxes. The implementation is kinda hackish due to the limitations of the theme parser. The only property type that can contain multiple distance values is Padding, so I used that. * Use new array syntax for tab-stops
Diffstat (limited to 'include/widgets/widget-internal.h')
-rw-r--r--include/widgets/widget-internal.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h
index 91c3a8d9..f7b7c25f 100644
--- a/include/widgets/widget-internal.h
+++ b/include/widgets/widget-internal.h
@@ -29,6 +29,28 @@
#define WIDGET_INTERNAL_H
#include "theme.h"
+
+/** Macro for initializing the RofiDistance struct. */
+#define WIDGET_DISTANCE_INIT \
+ (RofiDistance){ \
+ .base = { \
+ .distance = 0, \
+ .type = ROFI_PU_PX, \
+ .modtype = ROFI_DISTANCE_MODIFIER_NONE, \
+ .left = NULL, \
+ .right = NULL, \
+ }, \
+ .style = ROFI_HL_SOLID, \
+ }
+/* Macro for initializing the RofiPadding struct. */
+#define WIDGET_PADDING_INIT \
+ (RofiPadding){ \
+ .top = WIDGET_DISTANCE_INIT, \
+ .right = WIDGET_DISTANCE_INIT, \
+ .bottom = WIDGET_DISTANCE_INIT, \
+ .left = WIDGET_DISTANCE_INIT, \
+ }
+
/**
* Data structure holding the internal state of the Widget
*/