From 686be5856ce421edf79d147abd52954f7d0cb634 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 17 Aug 2017 19:04:01 +0200 Subject: [PATCH 1/7] Move PropertyType into rofi-types header and add check for names pairs. --- include/rofi-types.h | 37 ++++++++++++++++++++++++++++++++++++- include/theme.h | 31 ++----------------------------- source/rofi-types.c | 6 +++--- source/xrmoptions.c | 1 - subprojects/libnkutils | 2 +- test/theme-parser-test.c | 20 ++++++++++++++++++++ 6 files changed, 62 insertions(+), 35 deletions(-) diff --git a/include/rofi-types.h b/include/rofi-types.h index 4970e453..0e75c389 100644 --- a/include/rofi-types.h +++ b/include/rofi-types.h @@ -1,6 +1,41 @@ #ifndef INCLUDE_ROFI_TYPES_H #define INCLUDE_ROFI_TYPES_H -extern const char *PropertyTypeName[]; +/** + * Type of property + */ +typedef enum +{ + /** Integer */ + P_INTEGER, + /** Double */ + P_DOUBLE, + /** String */ + P_STRING, + /** Boolean */ + P_BOOLEAN, + /** Color */ + P_COLOR, + /** RofiPadding */ + P_PADDING, + /** Link to global setting */ + P_LINK, + /** Position */ + P_POSITION, + /** Highlight */ + P_HIGHLIGHT, + /** List */ + P_LIST, + /** Orientation */ + P_ORIENTATION, + /** Number of types. */ + P_NUM_TYPES, +} PropertyType; + +/** + * This array maps PropertyType to a user-readable name. + * It is important this is kept in sync. + */ +extern const char * const PropertyTypeName[P_NUM_TYPES]; #endif // INCLUDE_ROFI_TYPES_H diff --git a/include/theme.h b/include/theme.h index c0182e64..5e554b4c 100644 --- a/include/theme.h +++ b/include/theme.h @@ -31,7 +31,8 @@ #include #include #include -#include "theme.h" + +#include "rofi-types.h" /** Style of text highlight */ typedef enum @@ -95,34 +96,6 @@ typedef enum ROFI_ORIENTATION_VERTICAL, ROFI_ORIENTATION_HORIZONTAL } RofiOrientation; -/** - * Type of property - */ -typedef enum -{ - /** Integer */ - P_INTEGER, - /** Double */ - P_DOUBLE, - /** String */ - P_STRING, - /** Boolean */ - P_BOOLEAN, - /** Color */ - P_COLOR, - /** RofiPadding */ - P_PADDING, - /** Link to global setting */ - P_LINK, - /** Position */ - P_POSITION, - /** Highlight */ - P_HIGHLIGHT, - /** List */ - P_LIST, - /** Orientation */ - P_ORIENTATION, -} PropertyType; /** * Represent the color in theme. diff --git a/source/rofi-types.c b/source/rofi-types.c index d0676f40..ae42e97d 100644 --- a/source/rofi-types.c +++ b/source/rofi-types.c @@ -3,7 +3,7 @@ /** * Name of the property type */ -const char *PropertyTypeName[] = { +const char * const PropertyTypeName[P_NUM_TYPES] = { /** Integer */ "Integer", /** Double */ @@ -14,8 +14,8 @@ const char *PropertyTypeName[] = { "Boolean", /** Color */ "Color", - /** RofiPadding */ - "RofiPadding", + /** Padding */ + "Padding", /** Link to global setting */ "Reference", /** Position */ diff --git a/source/xrmoptions.c b/source/xrmoptions.c index af8fe846..1eff4246 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -391,7 +391,6 @@ void config_parse_cmd_options ( void ) static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error ) { - extern const char *PropertyTypeName[]; if ( option->type == xrm_String ) { if ( p->type != P_STRING && p->type != P_LIST ) { *error = g_strdup_printf ( "Option: %s needs to be set with a string not a %s.", option->name, PropertyTypeName[p->type] ); diff --git a/subprojects/libnkutils b/subprojects/libnkutils index 2c5f1b26..3467c6a4 160000 --- a/subprojects/libnkutils +++ b/subprojects/libnkutils @@ -1 +1 @@ -Subproject commit 2c5f1b2654a9b4480b857cd8395af127a6c55199 +Subproject commit 3467c6a4ee3b7a2f53dfd0e15cd72f00d782a0dd diff --git a/test/theme-parser-test.c b/test/theme-parser-test.c index b14b358a..cd9e6ca6 100644 --- a/test/theme-parser-test.c +++ b/test/theme-parser-test.c @@ -1233,6 +1233,25 @@ START_TEST ( test_prepare_path ) g_free ( current_dir ); } END_TEST + + +START_TEST(test_properties_types_names) +{ + ck_assert_str_eq ( PropertyTypeName[P_INTEGER], "Integer"); + ck_assert_str_eq ( PropertyTypeName[P_DOUBLE], "Double"); + ck_assert_str_eq ( PropertyTypeName[P_STRING], "String"); + ck_assert_str_eq ( PropertyTypeName[P_BOOLEAN], "Boolean"); + ck_assert_str_eq ( PropertyTypeName[P_COLOR], "Color"); + ck_assert_str_eq ( PropertyTypeName[P_PADDING], "Padding"); + ck_assert_str_eq ( PropertyTypeName[P_LINK], "Reference"); + ck_assert_str_eq ( PropertyTypeName[P_POSITION], "Position"); + ck_assert_str_eq ( PropertyTypeName[P_HIGHLIGHT], "Highlight"); + ck_assert_str_eq ( PropertyTypeName[P_LIST], "List"); + ck_assert_str_eq ( PropertyTypeName[P_ORIENTATION], "Orientation"); + +} +END_TEST + static Suite * theme_parser_suite (void) { Suite *s; @@ -1244,6 +1263,7 @@ static Suite * theme_parser_suite (void) { tc_core = tcase_create("Core"); tcase_add_checked_fixture(tc_core, theme_parser_setup, theme_parser_teardown); + tcase_add_test(tc_core, test_properties_types_names); tcase_add_test(tc_core, test_core_empty_string); tcase_add_test(tc_core, test_core_empty_global_section); tcase_add_test(tc_core, test_core_empty_section); From 5dd8e216e1023b377fa1bf3879907e41c1652b9b Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 17 Aug 2017 19:27:45 +0200 Subject: [PATCH 2/7] travis: Install Meson 0.41.2 Signed-off-by: Quentin Glidic --- .travis.yml | 2 +- subprojects/libnkutils | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87f6dfa1..8d00c618 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ before_install: # TODO: We install xkbcommon here, until Travis use an up-to-date enough Ubuntu install: - sudo apt-get install -y --force-yes libxkbcommon-dev libxkbcommon-x11-dev flex/trusty-backports libfl-dev/trusty-backports - - pip3 install meson + - pip3 install meson==0.41.2 - wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip - unzip ninja-linux.zip - export PATH=$(pwd):$PATH diff --git a/subprojects/libnkutils b/subprojects/libnkutils index 3467c6a4..2c5f1b26 160000 --- a/subprojects/libnkutils +++ b/subprojects/libnkutils @@ -1 +1 @@ -Subproject commit 3467c6a4ee3b7a2f53dfd0e15cd72f00d782a0dd +Subproject commit 2c5f1b2654a9b4480b857cd8395af127a6c55199 From 9105e5549f32c0ff2130d6904c07cedc0094ffad Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 17 Aug 2017 22:45:35 +0200 Subject: [PATCH 3/7] Move all property structs/enums into rofi-types --- include/rofi-types.h | 144 +++++++++++++++++++++++++++++++++++++++++++ include/theme.h | 140 ----------------------------------------- 2 files changed, 144 insertions(+), 140 deletions(-) diff --git a/include/rofi-types.h b/include/rofi-types.h index 0e75c389..e6a2026d 100644 --- a/include/rofi-types.h +++ b/include/rofi-types.h @@ -1,6 +1,8 @@ #ifndef INCLUDE_ROFI_TYPES_H #define INCLUDE_ROFI_TYPES_H +#include + /** * Type of property */ @@ -38,4 +40,146 @@ typedef enum */ extern const char * const PropertyTypeName[P_NUM_TYPES]; + +/** Style of text highlight */ +typedef enum +{ + /** no highlight */ + ROFI_HL_NONE = 0, + /** bold */ + ROFI_HL_BOLD = 1, + /** underline */ + ROFI_HL_UNDERLINE = 2, + /** strikethrough */ + ROFI_HL_STRIKETHROUGH = 16, + /** small caps */ + ROFI_HL_SMALL_CAPS = 32, + /** italic */ + ROFI_HL_ITALIC = 4, + /** color */ + ROFI_HL_COLOR = 8 +} RofiHighlightStyle; + +/** Style of line */ +typedef enum +{ + /** Solid line */ + ROFI_HL_SOLID, + /** Dashed line */ + ROFI_HL_DASH +} RofiLineStyle; + +/** + * Distance unit type. + */ +typedef enum +{ + /** PixelWidth in pixels. */ + ROFI_PU_PX, + /** PixelWidth in EM. */ + ROFI_PU_EM, + /** PixelWidget in percentage */ + ROFI_PU_PERCENT, +} RofiPixelUnit; + +/** + * Structure representing a distance. + */ +typedef struct +{ + /** Distance */ + double distance; + /** Unit type of the distance */ + RofiPixelUnit type; + /** Style of the line (optional)*/ + RofiLineStyle style; +} RofiDistance; + +/** + * Type of orientation. + */ +typedef enum +{ + ROFI_ORIENTATION_VERTICAL, + ROFI_ORIENTATION_HORIZONTAL +} RofiOrientation; + +/** + * Represent the color in theme. + */ +typedef struct +{ + /** red channel */ + double red; + /** green channel */ + double green; + /** blue channel */ + double blue; + /** alpha channel */ + double alpha; +} ThemeColor; + +/** + * RofiPadding + */ +typedef struct +{ + RofiDistance top; + RofiDistance right; + RofiDistance bottom; + RofiDistance left; +} RofiPadding; + +/** + * Theme highlight. + */ +typedef struct +{ + /** style to display */ + RofiHighlightStyle style; + /** Color */ + ThemeColor color; +} RofiHighlightColorStyle; + +typedef union +{ + /** integer */ + int i; + /** Double */ + double f; + /** String */ + char *s; + /** boolean */ + gboolean b; + /** Color */ + ThemeColor color; + /** RofiPadding */ + RofiPadding padding; + /** Reference */ + struct + { + /** Name */ + char *name; + /** Cached looked up ref */ + struct Property *ref; + } link; + /** Highlight Style */ + RofiHighlightColorStyle highlight; + /** List */ + GList *list; +} PropertyValue; + +/** + * Property structure. + */ +typedef struct Property +{ + /** Name of property */ + char *name; + /** Type of property. */ + PropertyType type; + /** Value */ + PropertyValue value; +} Property; + #endif // INCLUDE_ROFI_TYPES_H diff --git a/include/theme.h b/include/theme.h index 5e554b4c..6c06a956 100644 --- a/include/theme.h +++ b/include/theme.h @@ -34,146 +34,6 @@ #include "rofi-types.h" -/** Style of text highlight */ -typedef enum -{ - /** no highlight */ - ROFI_HL_NONE = 0, - /** bold */ - ROFI_HL_BOLD = 1, - /** underline */ - ROFI_HL_UNDERLINE = 2, - /** strikethrough */ - ROFI_HL_STRIKETHROUGH = 16, - /** small caps */ - ROFI_HL_SMALL_CAPS = 32, - /** italic */ - ROFI_HL_ITALIC = 4, - /** color */ - ROFI_HL_COLOR = 8 -} RofiHighlightStyle; - -/** Style of line */ -typedef enum -{ - /** Solid line */ - ROFI_HL_SOLID, - /** Dashed line */ - ROFI_HL_DASH -} RofiLineStyle; - -/** - * Distance unit type. - */ -typedef enum -{ - /** PixelWidth in pixels. */ - ROFI_PU_PX, - /** PixelWidth in EM. */ - ROFI_PU_EM, - /** PixelWidget in percentage */ - ROFI_PU_PERCENT, -} RofiPixelUnit; - -/** - * Structure representing a distance. - */ -typedef struct -{ - /** Distance */ - double distance; - /** Unit type of the distance */ - RofiPixelUnit type; - /** Style of the line (optional)*/ - RofiLineStyle style; -} RofiDistance; - -/** - * Type of orientation. - */ -typedef enum -{ - ROFI_ORIENTATION_VERTICAL, - ROFI_ORIENTATION_HORIZONTAL -} RofiOrientation; - -/** - * Represent the color in theme. - */ -typedef struct -{ - /** red channel */ - double red; - /** green channel */ - double green; - /** blue channel */ - double blue; - /** alpha channel */ - double alpha; -} ThemeColor; - -/** - * RofiPadding - */ -typedef struct -{ - RofiDistance top; - RofiDistance right; - RofiDistance bottom; - RofiDistance left; -} RofiPadding; - -/** - * Theme highlight. - */ -typedef struct -{ - /** style to display */ - RofiHighlightStyle style; - /** Color */ - ThemeColor color; -} RofiHighlightColorStyle; - -typedef union -{ - /** integer */ - int i; - /** Double */ - double f; - /** String */ - char *s; - /** boolean */ - gboolean b; - /** Color */ - ThemeColor color; - /** RofiPadding */ - RofiPadding padding; - /** Reference */ - struct - { - /** Name */ - char *name; - /** Cached looked up ref */ - struct Property *ref; - } link; - /** Highlight Style */ - RofiHighlightColorStyle highlight; - /** List */ - GList *list; -} PropertyValue; - -/** - * Property structure. - */ -typedef struct Property -{ - /** Name of property */ - char *name; - /** Type of property. */ - PropertyType type; - /** Value */ - PropertyValue value; -} Property; /** * ThemeWidget. */ From 3c52f1514018c2a4af0c496193731a1035cadb17 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 18 Aug 2017 11:38:54 +0200 Subject: [PATCH 4/7] Move more enums to rofi-types.h --- config/config.c | 1 + include/rofi-types.h | 32 ++++++++++++++++++++++++++++++++ include/rofi.h | 1 + include/settings.h | 31 ------------------------------- include/theme.h | 2 -- source/rofi.c | 2 +- source/view.c | 2 +- source/xcb.c | 1 + 8 files changed, 37 insertions(+), 35 deletions(-) diff --git a/config/config.c b/config/config.c index fa8d4238..67342346 100644 --- a/config/config.c +++ b/config/config.c @@ -29,6 +29,7 @@ #include #include #include +#include "rofi-types.h" #include "settings.h" Settings config = { diff --git a/include/rofi-types.h b/include/rofi-types.h index e6a2026d..80998463 100644 --- a/include/rofi-types.h +++ b/include/rofi-types.h @@ -141,6 +141,38 @@ typedef struct ThemeColor color; } RofiHighlightColorStyle; + +/** + * Enumeration indicating location or gravity of window. + * + * \verbatim WL_NORTH_WEST WL_NORTH WL_NORTH_EAST \endverbatim + * \verbatim WL_EAST WL_CENTER WL_EAST \endverbatim + * \verbatim WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST\endverbatim + * + * @ingroup CONFIGURATION + */ +typedef enum +{ + /** Center */ + WL_CENTER = 0, + /** Top middle */ + WL_NORTH = 1, + /** Middle right */ + WL_EAST = 2, + /** Bottom middle */ + WL_SOUTH = 4, + /** Middle left */ + WL_WEST = 8, + /** Left top corner. */ + WL_NORTH_WEST = WL_NORTH | WL_WEST, + /** Top right */ + WL_NORTH_EAST = WL_NORTH | WL_EAST, + /** Bottom right */ + WL_SOUTH_EAST = WL_SOUTH | WL_EAST, + /** Bottom left */ + WL_SOUTH_WEST = WL_SOUTH | WL_WEST, +} WindowLocation; + typedef union { /** integer */ diff --git a/include/rofi.h b/include/rofi.h index 8830b62d..5b513b88 100644 --- a/include/rofi.h +++ b/include/rofi.h @@ -32,6 +32,7 @@ #include #include #include +#include "rofi-types.h" #include "keyb.h" #include "mode.h" #include "view.h" diff --git a/include/settings.h b/include/settings.h index 2ea8b34c..295a8cd0 100644 --- a/include/settings.h +++ b/include/settings.h @@ -43,37 +43,6 @@ typedef enum MM_FUZZY = 3 } MatchingMethod; -/** - * Enumeration indicating location or gravity of window. - * - * \verbatim WL_NORTH_WEST WL_NORTH WL_NORTH_EAST \endverbatim - * \verbatim WL_EAST WL_CENTER WL_EAST \endverbatim - * \verbatim WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST\endverbatim - * - * @ingroup CONFIGURATION - */ -typedef enum -{ - /** Center */ - WL_CENTER = 0, - /** Top middle */ - WL_NORTH = 1, - /** Middle right */ - WL_EAST = 2, - /** Bottom middle */ - WL_SOUTH = 4, - /** Middle left */ - WL_WEST = 8, - /** Left top corner. */ - WL_NORTH_WEST = WL_NORTH | WL_WEST, - /** Top right */ - WL_NORTH_EAST = WL_NORTH | WL_EAST, - /** Bottom right */ - WL_SOUTH_EAST = WL_SOUTH | WL_EAST, - /** Bottom left */ - WL_SOUTH_WEST = WL_SOUTH | WL_WEST, -} WindowLocation; - /** * Settings structure holding all (static) configurable options. * @ingroup CONFIGURATION diff --git a/include/theme.h b/include/theme.h index 6c06a956..f01a325c 100644 --- a/include/theme.h +++ b/include/theme.h @@ -30,8 +30,6 @@ #include #include #include -#include - #include "rofi-types.h" /** diff --git a/source/rofi.c b/source/rofi.c index 44e2a19d..fda23e4c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -45,11 +45,11 @@ #include +#include "rofi.h" #include "display.h" #include "settings.h" #include "mode.h" -#include "rofi.h" #include "helper.h" #include "widgets/textbox.h" #include "xrmoptions.h" diff --git a/source/view.c b/source/view.c index 1827ee97..9f3b3c59 100644 --- a/source/view.c +++ b/source/view.c @@ -48,11 +48,11 @@ #define SN_API_NOT_YET_FROZEN #include +#include "rofi.h" #include "timings.h" #include "settings.h" -#include "rofi.h" #include "mode.h" #include "display.h" #include "xcb-internal.h" diff --git a/source/xcb.c b/source/xcb.c index ba4f73ff..db41ec70 100644 --- a/source/xcb.c +++ b/source/xcb.c @@ -52,6 +52,7 @@ #define SN_API_NOT_YET_FROZEN /* This function is declared as sn_launcher_context_set_application_id but implemented as sn_launcher_set_application_id */ #define sn_launcher_context_set_application_id sn_launcher_set_application_id +#include "rofi-types.h" #include #include "display.h" #include "xcb-internal.h" From 0ecd8a9a40e4b4e597750826265947a90726863c Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 19 Aug 2017 16:30:13 +0200 Subject: [PATCH 5/7] Some release notes update. --- releasenotes/1.4.0/release-1.4.0.markdown | 38 ++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/releasenotes/1.4.0/release-1.4.0.markdown b/releasenotes/1.4.0/release-1.4.0.markdown index 55dffa0c..00977ab0 100644 --- a/releasenotes/1.4.0/release-1.4.0.markdown +++ b/releasenotes/1.4.0/release-1.4.0.markdown @@ -20,12 +20,48 @@ release notes for the full list of changes. ## CSS Like Theme engine +The biggest new feature of this release is the theme engine. It has a completely new theme format modelled after CSS. +This allows for a lot more customizations. -## Flexible layout +### Colors +You can now set the color on each widget independent in most of the CSS supported color formats (hsl, cmyk, rgb, etc.). + +> TODO: add picture of rofi rainbow colors. + +### Borders + +On every widget we can now configure a border for each of the four sides, the color of the border, the style of the +border and the radius of the corners. + +> TODO: Add picture of crazy borders. + +This combined with (fake) transparency can make for a very nice looking, rounded rofi experience. + +> TODO: Rounded corner rofi. + +### Fonts + +An often made request was support for different fonts for the entry box and the list. With the new theme, it is possible +to change the font and size of all widgets. + +> TODO: picture of mixture of fonts. + +### Flexible layout + +To top all these changes, as an advanced feature the whole layout of the window can be changed. Making it possible to +mimic the original dmenu view, or make it appear as a minimal context menu. + +> TODO: insert two screenshot. ## Icons +Another often made request, I never expected to be implemented, was icon support. But with the help of SardemFF7 an +implementation was possible that correctly follows the XDG icon specification and does not negatively impact the +performance. + +> TODO: Screenshot with icons. + ## More flexible key and mouse bindings From 73e174b67bb6ddca05f505a9af15b250193b01aa Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 28 Aug 2017 08:05:44 +0200 Subject: [PATCH 6/7] Update release notess some more. --- releasenotes/1.4.0/release-1.4.0.markdown | 28 ++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/releasenotes/1.4.0/release-1.4.0.markdown b/releasenotes/1.4.0/release-1.4.0.markdown index 00977ab0..d7e9d328 100644 --- a/releasenotes/1.4.0/release-1.4.0.markdown +++ b/releasenotes/1.4.0/release-1.4.0.markdown @@ -1,7 +1,7 @@ # V1.4.0: I reject your truth and trumpstitute my own > This release contains some major changes. One of them being a new theme engine. The migration from older versions -> to this version might not go flawless. +> to this version might not go flawless. With more then 700 commits since the last version, this is one of the biggest releases so far. In this version we used the groundwork laid in v1.3.0 and went completely nuts. This release should satisfy the die-hard @@ -11,28 +11,34 @@ The great work of [SardemFF7](https://github.com/SardemFF7/) simplified the code handling. It also made it possible to add a often requested feature of icons (correctly using the icon-theme). A feature I never expected to be added. -A last big addition, is support for plugins. Allowing the addition of some weird/fancy features. Currently two plugins -are available, [blezz](https://gitcrate.org/qtools/rofi-blezz) a quick launch menu with it own menu definition and -[top](https://gitcrate.org/qtools/rofi-top/) displaying running processes. +A last big addition and still in beta, is support for plugins. Allowing the addition of some weird/fancy features. +Currently two plugins are available, [blezz](https://gitcrate.org/qtools/rofi-blezz) a quick launch menu with it own +menu definition and [top](https://gitcrate.org/qtools/rofi-top/) displaying running processes. Beside these major changes, this release includes a lot of bug-fixes and small improvements. See the bottom of this release notes for the full list of changes. + ## CSS Like Theme engine -The biggest new feature of this release is the theme engine. It has a completely new theme format modelled after CSS. -This allows for a lot more customizations. +The biggest new feature of this release is the theme engine. Building on the changes made in v1.3.0 we implemented a new +theme engine and it has a completely new theme format modelled after CSS. We decided to model the theme format after +CSS because many people are familiar with it and it seems to be a reasonable fit. While the themes are a lot more +verbose now, it does allow for a lot of extra customizations. + +It is now possible to theme each widget in rofi independently: ### Colors -You can now set the color on each widget independent in most of the CSS supported color formats (hsl, cmyk, rgb, etc.). +You can now set the color on each widget independent in most of the CSS supported color formats (hsl, cmyk, rgb, etc.) +and each color can have a transparency. Each widget has three colors: background, foreground and text. > TODO: add picture of rofi rainbow colors. ### Borders On every widget we can now configure a border for each of the four sides, the color of the border, the style of the -border and the radius of the corners. +border (solid or dashed0) and the radius of the corners can be set. > TODO: Add picture of crazy borders. @@ -71,6 +77,12 @@ performance. ## Screenshot +## Configuration File + +The new theme format can now (as an alpha) feature be used to set rofi's configuration. In the future, when we add +wayland support, we want to get rid of the current Xresources (X11) based configuration format. +You can see how this would look using: `rofi -dump-config`. + ## Detailed Changelog From 508e39c3f3ff2fab3ef8d5ccf740df83539b9557 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 29 Aug 2017 10:40:24 +0200 Subject: [PATCH 7/7] Set cursor to end of input field. Fixes: #662 --- include/widgets/textbox.h | 7 +++++++ source/view.c | 1 + source/widgets/textbox.c | 9 +-------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index ec6f85f0..b330045b 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -313,5 +313,12 @@ PangoAttrList *textbox_get_pango_attributes ( textbox *tb ); */ const char *textbox_get_visible_text ( const textbox *tb ); int textbox_get_desired_width ( widget *wid ); + +/** + * @param tb Handle to the textbox + * + * Move the cursor to the end of the string. + */ +void textbox_cursor_end ( textbox *tb ); /*@}*/ #endif //ROFI_TEXTBOX_H diff --git a/source/view.c b/source/view.c index 9f3b3c59..476a3085 100644 --- a/source/view.c +++ b/source/view.c @@ -1696,6 +1696,7 @@ RofiViewState *rofi_view_create ( Mode *sw, if ( state->text && input ) { textbox_text ( state->text, input ); + textbox_cursor_end ( state->text ); } state->overlay = textbox_create ( WIDGET_TYPE_TEXTBOX_TEXT, "window.overlay", TB_AUTOWIDTH | TB_AUTOHEIGHT, URGENT, "blaat", 0.5, 0 ); diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 64d4fa5a..a2854ff3 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -49,13 +49,6 @@ static int textbox_get_width ( widget * ); static int _textbox_get_height ( widget * ); static void __textbox_update_pango_text ( textbox *tb ); -/** - * @param tb Handle to the textbox - * - * Move the cursor to the end of the string. - */ -static void textbox_cursor_end ( textbox *tb ); - /** Default pango context */ static PangoContext *p_context = NULL; /** The pango font metrics */ @@ -585,7 +578,7 @@ static void textbox_cursor_dec_word ( textbox *tb ) } // end of line -static void textbox_cursor_end ( textbox *tb ) +void textbox_cursor_end ( textbox *tb ) { if ( tb->text == NULL ) { tb->cursor = 0;