[sound-juicer] Replace GtkTable with GtkGrid
- From: Phillip Wood <pwood src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sound-juicer] Replace GtkTable with GtkGrid
- Date: Mon, 13 Feb 2017 10:56:08 +0000 (UTC)
commit 4a239a272ab111812bb10bd72162d8611d7cd653
Author: Phillip Wood <phillip wood dunelm org uk>
Date: Thu Sep 8 11:15:35 2016 +0100
Replace GtkTable with GtkGrid
GtkTable is deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=771107
data/sound-juicer.ui | 54 +++++++++++++++----------------------------------
src/sj-main.c | 12 +---------
2 files changed, 19 insertions(+), 47 deletions(-)
---
diff --git a/data/sound-juicer.ui b/data/sound-juicer.ui
index 9a8d89e..0ecdbca 100644
--- a/data/sound-juicer.ui
+++ b/data/sound-juicer.ui
@@ -140,20 +140,19 @@
<property name="orientation">vertical</property>
<property name="spacing">8</property>
<child>
- <object class="GtkTable" id="entry_table">
+ <object class="GtkGrid" id="entry_grid">
<property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
<property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="margin-top">6</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">12</property>
<child>
<object class="GtkEntry" id="genre_entry">
<property name="visible">True</property>
+ <property name="hexpand">True</property>
<property name="can_focus">True</property>
<signal name="activate" handler="on_activate_move_focus"/>
<signal name="changed" handler="on_genre_edit_changed"/>
@@ -239,11 +238,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_SHRINK | GTK_FILL</property>
- <property name="y_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
@@ -257,28 +252,24 @@
<attribute name="weight" value="bold"/>
</attributes>
</object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
</child>
<child>
<object class="GtkEntry" id="title_entry">
<property name="visible">True</property>
+ <property name="hexpand">True</property>
<property name="can_focus">True</property>
<signal name="activate" handler="on_activate_move_focus"/>
<signal name="changed" handler="on_title_edit_changed" after="yes"/>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
+ <property name="margin-top">6</property>
<property name="label" translatable="yes">_Artist:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">artist_entry</property>
@@ -287,31 +278,29 @@
</attributes>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkEntry" id="artist_entry">
<property name="visible">True</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
<property name="can_focus">True</property>
<signal name="activate" handler="on_activate_move_focus"/>
<signal name="changed" handler="on_person_edit_changed" after="yes"/>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="composer_label">
<property name="visible">False</property>
<property name="xalign">0</property>
+ <property name="margin-top">6</property>
<property name="label" translatable="yes">_Composer:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">composer_entry</property>
@@ -320,31 +309,29 @@
</attributes>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkEntry" id="composer_entry">
<property name="visible">False</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
<property name="can_focus">True</property>
<signal name="activate" handler="on_activate_move_focus"/>
<signal name="changed" handler="on_person_edit_changed" after="yes"/>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label31">
<property name="visible">True</property>
<property name="xalign">0</property>
+ <property name="margin-top">6</property>
<property name="label" translatable="yes">_Genre:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">genre_entry</property>
@@ -353,16 +340,15 @@
</attributes>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
+ <property name="margin-top">9</property>
<property name="label" translatable="yes">Duration:</property>
<accessibility>
<relation type="label-for" target="duration_label"/>
@@ -372,28 +358,22 @@
</attributes>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="duration_label">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="ypad">3</property>
+ <property name="margin-top">9</property>
<accessibility>
<relation type="labelled-by" target="label3"/>
</accessibility>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
</object>
diff --git a/src/sj-main.c b/src/sj-main.c
index 209ffac..402e1da 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -80,7 +80,7 @@ GSettings *sj_settings;
GtkWidget *main_window;
static GtkWidget *submit_bar, *submit_label;
static GtkWidget *title_entry, *artist_entry, *composer_label, *composer_entry, *duration_label,
*genre_entry, *year_entry, *disc_number_entry;
-static GtkWidget *entry_table; /* GtkTable containing composer_entry */
+static GtkWidget *entry_grid; /* GtkGrid containing album title, artist etc. */
static GtkTreeViewColumn *composer_column; /* Treeview column containing composers */
static GtkWidget *track_listview, *extract_button, *play_button, *select_button;
static GtkWidget *multiple_album_dialog, *status_bar, *submit_button, *reload_button;
@@ -121,7 +121,6 @@ static CellCbContext cell_editing_context;
#define DEFAULT_PARANOIA 15
#define RAISE_WINDOW "raise-window"
-#define COMPOSER_ROW 2 /* Row of entry_table containing composer_entry */
void
sj_main_set_title (const char* detail)
@@ -462,7 +461,6 @@ static void on_duplicate_activate (GSimpleAction *action, GVariant *parameter, g
}
}
-#define TABLE_ROW_SPACING 6 /* spacing of rows in entry_table */
/*
* Show composer entry and composer column in track listview
@@ -471,8 +469,6 @@ static void
show_composer_fields (void)
{
if (!gtk_widget_get_visible (GTK_WIDGET (composer_label))) {
- gtk_table_set_row_spacing (GTK_TABLE (entry_table), COMPOSER_ROW,
- TABLE_ROW_SPACING);
gtk_widget_show (GTK_WIDGET (composer_entry));
gtk_widget_show (GTK_WIDGET (composer_label));
gtk_tree_view_column_set_visible (composer_column, TRUE);
@@ -488,7 +484,6 @@ static void
hide_composer_fields (void)
{
if (gtk_widget_get_visible (GTK_WIDGET (composer_label))) {
- gtk_table_set_row_spacing (GTK_TABLE (entry_table), COMPOSER_ROW, 0);
gtk_widget_hide (GTK_WIDGET (composer_entry));
gtk_widget_hide (GTK_WIDGET (composer_label));
gtk_tree_view_column_set_visible (composer_column, FALSE);
@@ -1830,7 +1825,7 @@ startup_cb (GApplication *app, gpointer user_data)
play_button = GET_WIDGET ("play_button");
select_button = GET_WIDGET ("select_button");
status_bar = GET_WIDGET ("status_bar");
- entry_table = GET_WIDGET ("entry_table");
+ entry_grid = GET_WIDGET ("entry_grid");
sj_main_window_init (GTK_WINDOW (main_window));
@@ -1929,9 +1924,6 @@ startup_cb (GApplication *app, gpointer user_data)
setup_genre_entry (genre_entry);
- /* Remove row spacing from hidden row containing composer_entry */
- gtk_table_set_row_spacing (GTK_TABLE (entry_table), COMPOSER_ROW, 0);
-
track_store = gtk_list_store_new (COLUMN_TOTAL, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER);
gtk_tree_view_set_model (GTK_TREE_VIEW (track_listview), GTK_TREE_MODEL (track_store));
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]