diff options
Diffstat (limited to 'libslab')
-rw-r--r-- | libslab/app-shell.c | 14 | ||||
-rw-r--r-- | libslab/application-tile.c | 10 | ||||
-rw-r--r-- | libslab/directory-tile.c | 10 | ||||
-rw-r--r-- | libslab/document-tile.c | 15 | ||||
-rw-r--r-- | libslab/slab-section.c | 5 | ||||
-rw-r--r-- | libslab/system-tile.c | 5 | ||||
-rw-r--r-- | libslab/tile-action.c | 5 |
7 files changed, 62 insertions, 2 deletions
diff --git a/libslab/app-shell.c b/libslab/app-shell.c index 45e6feae..eb6af9da 100644 --- a/libslab/app-shell.c +++ b/libslab/app-shell.c @@ -406,7 +406,12 @@ create_actions_section (AppShellData * app_data, const gchar * title, action = (AppAction *) actions->data; header = gtk_label_new (action->name); - gtk_misc_set_alignment (GTK_MISC (header), 0, 0.5); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else + gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif launcher = nameplate_tile_new (NULL, NULL, header, NULL); g_object_set_data (G_OBJECT (launcher), APP_ACTION_KEY, action->item); @@ -697,7 +702,12 @@ create_application_category_sections (AppShellData * app_data) GtkWidget *hbox; GtkWidget *table; - gtk_misc_set_alignment (GTK_MISC (header), 0, 0.5); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else + gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif data->group_launcher = TILE (nameplate_tile_new (NULL, NULL, header, NULL)); g_object_ref (data->group_launcher); diff --git a/libslab/application-tile.c b/libslab/application-tile.c index 1bcd10d5..88fe066a 100644 --- a/libslab/application-tile.c +++ b/libslab/application-tile.c @@ -402,7 +402,12 @@ create_header (const gchar *name) header = gtk_label_new (name); gtk_label_set_line_wrap (GTK_LABEL (header), TRUE); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif g_signal_connect ( G_OBJECT (header), @@ -421,7 +426,12 @@ create_subheader (const gchar *desc) subheader = gtk_label_new (desc); gtk_label_set_ellipsize (GTK_LABEL (subheader), PANGO_ELLIPSIZE_END); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (subheader, GTK_ALIGN_START); + gtk_widget_set_valign (subheader, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (subheader), 0.0, 0.5); +#endif gtk_widget_modify_fg ( subheader, GTK_STATE_NORMAL, diff --git a/libslab/directory-tile.c b/libslab/directory-tile.c index 272d0587..f8a57cfb 100644 --- a/libslab/directory-tile.c +++ b/libslab/directory-tile.c @@ -342,7 +342,12 @@ create_header (const gchar *name) header = gtk_label_new (name); gtk_label_set_ellipsize (GTK_LABEL (header), PANGO_ELLIPSIZE_END); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif header_bin = gtk_alignment_new (0.0, 0.5, 1.0, 0.0); gtk_container_add (GTK_CONTAINER (header_bin), header); @@ -409,7 +414,12 @@ rename_entry_activate_cb (GtkEntry *entry, gpointer user_data) g_object_unref (dst_file); header = gtk_label_new (priv->basename); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif child = gtk_bin_get_child (priv->header_bin); diff --git a/libslab/document-tile.c b/libslab/document-tile.c index 412be01b..f2187b04 100644 --- a/libslab/document-tile.c +++ b/libslab/document-tile.c @@ -690,7 +690,12 @@ create_header (const gchar *name) header = gtk_label_new (name); gtk_label_set_ellipsize (GTK_LABEL (header), PANGO_ELLIPSIZE_END); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif header_bin = gtk_alignment_new (0.0, 0.5, 1.0, 0.0); gtk_container_add (GTK_CONTAINER (header_bin), header); @@ -708,7 +713,12 @@ create_subheader (const gchar *desc) subheader = gtk_label_new (desc); gtk_label_set_ellipsize (GTK_LABEL (subheader), PANGO_ELLIPSIZE_END); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (subheader, GTK_ALIGN_START); + gtk_widget_set_valign (subheader, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (subheader), 0.0, 0.5); +#endif gtk_widget_modify_fg (subheader, GTK_STATE_NORMAL, >k_widget_get_style (subheader)->fg[GTK_STATE_INSENSITIVE]); @@ -800,7 +810,12 @@ rename_entry_activate_cb (GtkEntry *entry, gpointer user_data) } header = gtk_label_new (priv->basename); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif child = gtk_bin_get_child (priv->header_bin); diff --git a/libslab/slab-section.c b/libslab/slab-section.c index 3235c59a..c03f0c94 100644 --- a/libslab/slab-section.c +++ b/libslab/slab-section.c @@ -150,7 +150,12 @@ slab_section_new_with_markup (const gchar * title_markup, SlabStyle style) section->title = gtk_label_new (title_markup); gtk_label_set_use_markup (GTK_LABEL (section->title), TRUE); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (section->title, GTK_ALIGN_START); + gtk_widget_set_valign (section->title, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (section->title), 0.0, 0.5); +#endif gtk_widget_set_name (GTK_WIDGET (section), widget_theming_name); g_signal_connect (G_OBJECT (section), "style-set", G_CALLBACK (slab_section_style_set), diff --git a/libslab/system-tile.c b/libslab/system-tile.c index 598e6aa7..c60291c0 100644 --- a/libslab/system-tile.c +++ b/libslab/system-tile.c @@ -242,7 +242,12 @@ create_header (const gchar *name) header = gtk_label_new (name); gtk_label_set_use_underline (GTK_LABEL (header), TRUE); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (header, GTK_ALIGN_START); + gtk_widget_set_valign (header, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (header), 0.0, 0.5); +#endif return header; } diff --git a/libslab/tile-action.c b/libslab/tile-action.c index 8ad5ff83..8066b52f 100644 --- a/libslab/tile-action.c +++ b/libslab/tile-action.c @@ -83,7 +83,12 @@ tile_action_set_menu_item_label (TileAction * this, const gchar * markup) { label = gtk_label_new (markup); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (label, GTK_ALIGN_START); + gtk_widget_set_valign (label, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); +#endif this->menu_item = GTK_MENU_ITEM (gtk_menu_item_new ()); gtk_container_add (GTK_CONTAINER (this->menu_item), label); |