[libdazzle] shortcuts: tweaks and sizing group for shortcut
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: tweaks and sizing group for shortcut
- Date: Mon, 10 Jul 2017 01:03:50 +0000 (UTC)
commit 5a2e6a321eeaee7d3db30ec2139ed946d44a29de
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 9 18:03:07 2017 -0700
shortcuts: tweaks and sizing group for shortcut
src/shortcuts/dzl-shortcut-private.h | 3 +++
src/shortcuts/dzl-shortcut-simple-label.c | 17 +++++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-private.h b/src/shortcuts/dzl-shortcut-private.h
index ded16cc..f7e3690 100644
--- a/src/shortcuts/dzl-shortcut-private.h
+++ b/src/shortcuts/dzl-shortcut-private.h
@@ -21,6 +21,7 @@
#include "shortcuts/dzl-shortcut-chord.h"
#include "shortcuts/dzl-shortcut-closure-chain.h"
+#include "shortcuts/dzl-shortcut-simple-label.h"
#include "shortcuts/dzl-shortcut-manager.h"
#include "shortcuts/dzl-shortcut-theme.h"
@@ -103,6 +104,8 @@ gboolean _dzl_gtk_widget_activate_action (GtkWidget
GVariant *parameter);
GNode *_dzl_shortcut_manager_get_root (DzlShortcutManager *self);
DzlShortcutTheme *_dzl_shortcut_manager_get_internal_theme (DzlShortcutManager *self);
+void _dzl_shortcut_simple_label_set_size_group(DzlShortcutSimpleLabel *self,
+ GtkSizeGroup *size_group);
void _dzl_shortcut_theme_attach (DzlShortcutTheme *self);
void _dzl_shortcut_theme_detach (DzlShortcutTheme *self);
GtkTreeModel *_dzl_shortcut_theme_create_model (DzlShortcutTheme *self);
diff --git a/src/shortcuts/dzl-shortcut-simple-label.c b/src/shortcuts/dzl-shortcut-simple-label.c
index 190ffe5..3c8f8ef 100644
--- a/src/shortcuts/dzl-shortcut-simple-label.c
+++ b/src/shortcuts/dzl-shortcut-simple-label.c
@@ -155,15 +155,18 @@ dzl_shortcut_simple_label_init (DzlShortcutSimpleLabel *self)
"visible", TRUE,
"xalign", 0.0f,
NULL);
- dzl_gtk_widget_add_style_class (GTK_WIDGET (self->title), "dim-label");
+ dzl_gtk_widget_add_style_class (GTK_WIDGET (self->title), "title");
gtk_container_add_with_properties (GTK_CONTAINER (self), GTK_WIDGET (self->title),
"fill", TRUE,
"pack-type", GTK_PACK_START,
NULL);
self->accel_label = g_object_new (GTK_TYPE_LABEL,
+ "hexpand", TRUE,
+ "halign", GTK_ALIGN_START,
+ "margin-start", 12,
"visible", TRUE,
- "xalign", 1.0f,
+ "xalign", 0.0f,
NULL);
dzl_gtk_widget_add_style_class (GTK_WIDGET (self->accel_label), "dim-label");
gtk_container_add_with_properties (GTK_CONTAINER (self), GTK_WIDGET (self->accel_label),
@@ -276,3 +279,13 @@ dzl_shortcut_simple_label_set_title (DzlShortcutSimpleLabel *self,
gtk_label_set_label (self->title, title);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TITLE]);
}
+
+void
+_dzl_shortcut_simple_label_set_size_group(DzlShortcutSimpleLabel *self,
+ GtkSizeGroup *size_group)
+{
+ g_return_if_fail (DZL_IS_SHORTCUT_SIMPLE_LABEL (self));
+
+ if (size_group != NULL)
+ gtk_size_group_add_widget (size_group, GTK_WIDGET (self->title));
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]