summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 417eb5c)
raw | patch | inline | side by side (parent: 417eb5c)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 10 Sep 2007 18:17:07 +0000 (18:17 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 10 Sep 2007 18:17:07 +0000 (18:17 +0000) |
src/ege-select-one-action.cpp | patch | blob | history |
index 0bf1a3fc91a87344381348dbc66a4acf5e5a4a54..7e67c3daac3d4b4c514774c4bf93fbacf2946a05 100644 (file)
enum {
APPEARANCE_UNKNOWN = -1,
APPEARANCE_NONE = 0,
- APPEARANCE_FULL,
- APPEARANCE_COMPACT,
- APPEARANCE_MINIMAL,
+ APPEARANCE_FULL, // label, then all choices represented by separate buttons
+ APPEARANCE_COMPACT, // label, then choices in a drop-down menu
+ APPEARANCE_MINIMAL, // no label, just choices in a drop-down menu
};
struct _EgeSelectOneActionPrivate
gint index = 0;
GtkTooltips* tooltips = gtk_tooltips_new();
+ gchar* sss = 0;
+ g_object_get( G_OBJECT(action), "label", &sss, NULL );
+ if (sss) {
+ GtkWidget* lbl;
+ lbl = gtk_label_new(sss);
+ gtk_box_pack_start( GTK_BOX(holder), lbl, FALSE, FALSE, 4 );
+ }
+
valid = gtk_tree_model_get_iter_first( act->private_data->model, &iter );
while ( valid ) {
gchar* str = 0;
gtk_container_add( GTK_CONTAINER(item), holder );
} else {
- GtkWidget* holder = gtk_table_new( 1, 3, FALSE );
+ GtkWidget* holder = gtk_hbox_new( FALSE, 4 );
GtkWidget* normal = gtk_combo_box_new_with_model( act->private_data->model );
GtkCellRenderer * renderer = 0;
g_object_set_data( G_OBJECT(holder), "ege-combo-box", normal );
- GtkWidget* lbl = gtk_label_new(" ");
- gtk_table_attach( GTK_TABLE(holder), lbl, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0 );
- gtk_table_attach( GTK_TABLE(holder), normal, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0 );
- lbl = gtk_label_new(" ");
- gtk_table_attach( GTK_TABLE(holder), lbl, 2, 3, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0 );
+ if (act->private_data->appearanceMode == APPEARANCE_COMPACT) {
+ gchar* sss = 0;
+ g_object_get( G_OBJECT(action), "label", &sss, NULL );
+ if (sss) {
+ GtkWidget* lbl;
+ lbl = gtk_label_new(sss);
+ gtk_box_pack_start( GTK_BOX(holder), lbl, FALSE, FALSE, 4 );
+ }
+ }
+
+ gtk_box_pack_start( GTK_BOX(holder), normal, FALSE, FALSE, 0 );
+
gtk_container_add( GTK_CONTAINER(item), holder );
}