diff options
author | Robert Tari <robert@tari.in> | 2021-06-14 23:08:17 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-16 08:26:44 +0200 |
commit | 9be11d94c663ea66cd41a9364a78531537ae405e (patch) | |
tree | 51f125b8c5b0560b1ed44668591f6cf3f7b7e5f0 /data | |
parent | db18ded6c8a4ab9d4a0921a3f52e8f3507607238 (diff) | |
download | libayatana-common-9be11d94c663ea66cd41a9364a78531537ae405e.tar.gz libayatana-common-9be11d94c663ea66cd41a9364a78531537ae405e.tar.bz2 libayatana-common-9be11d94c663ea66cd41a9364a78531537ae405e.zip |
Add ability to ellipsize dynamic menu item lengths.
Plus making the maximum length of non-ellipsized strings configurable
via GSettings.
- data/org.ayatana.common.gschema.xml.in: Add file.
- data/CMakeLists.txt: Add file.
- CMakeLists.txt: Add gio-2.0 dependency + 'data' build folder.
- src/utils.*: Add ayatana_common_utils_elipsize function + include
glib-object.h and gio.h
- tests/tst_utils.cpp: Add StringFunctionsTest.
- tests/CMakeLists.txt: Add GLIB_LIBRARIES to target.
Diffstat (limited to 'data')
-rw-r--r-- | data/CMakeLists.txt | 6 | ||||
-rw-r--r-- | data/org.ayatana.common.gschema.xml.in | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt new file mode 100644 index 0000000..7f12337 --- /dev/null +++ b/data/CMakeLists.txt @@ -0,0 +1,6 @@ +# org.ayatana.common.gschema.xml + +find_package(GSettings) +set(ENV{LC_ALL} "C") +execute_process(COMMAND intltool-merge -quiet --xml-style --utf8 --no-translations "${CMAKE_CURRENT_SOURCE_DIR}/org.ayatana.common.gschema.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/org.ayatana.common.gschema.xml") +add_schema("org.ayatana.common.gschema.xml") diff --git a/data/org.ayatana.common.gschema.xml.in b/data/org.ayatana.common.gschema.xml.in new file mode 100644 index 0000000..30c5e03 --- /dev/null +++ b/data/org.ayatana.common.gschema.xml.in @@ -0,0 +1,10 @@ +<schemalist> + <schema gettext-domain="ayatana-common" id="org.ayatana.common" path="/org/ayatana/common/"> + <key name="max-menu-text-length" type="u"> + <range min="1" max="100"/> + <default>50</default> + <_summary>Maximum menu text length</_summary> + <_description>The number of characters to show in dynamic menu items before the text is ellipsized.</_description> + </key> + </schema> +</schemalist> |