作図ソフト dia の改良版
修訂 | 0d9ca9c09f83510e644a00223082f8cc55f2adf5 (tree) |
---|---|
時間 | 2014-09-06 02:44:33 |
作者 | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
layer-widget: Add edit name button to button row
This makes the layer list slightly wider, so it is loosing it's
scroll-bar for most diagrams I looked at.
@@ -156,6 +156,7 @@ static void dia_layer_set_layer(DiaLayerWidget *widget, Diagram *dia, Layer *lay | ||
156 | 156 | static void dia_layer_update_from_layer(DiaLayerWidget *widget); |
157 | 157 | |
158 | 158 | static void layer_dialog_new_callback(GtkWidget *widget, gpointer gdata); |
159 | +static void layer_dialog_rename_callback(GtkWidget *widget, gpointer gdata); | |
159 | 160 | static void layer_dialog_raise_callback(GtkWidget *widget, gpointer gdata); |
160 | 161 | static void layer_dialog_lower_callback(GtkWidget *widget, gpointer gdata); |
161 | 162 | static void layer_dialog_delete_callback(GtkWidget *widget, gpointer gdata); |
@@ -163,6 +164,7 @@ static void layer_dialog_edit_layer(DiaLayerWidget *layer_widget, Diagram *dia, | ||
163 | 164 | |
164 | 165 | static ButtonData buttons[] = { |
165 | 166 | { GTK_STOCK_ADD, layer_dialog_new_callback, N_("New Layer") }, |
167 | + { GTK_STOCK_EDIT, layer_dialog_rename_callback, N_("Rename Layer") }, | |
166 | 168 | { GTK_STOCK_GO_UP, layer_dialog_raise_callback, N_("Raise Layer") }, |
167 | 169 | { GTK_STOCK_GO_DOWN, layer_dialog_lower_callback, N_("Lower Layer") }, |
168 | 170 | { GTK_STOCK_DELETE, layer_dialog_delete_callback, N_("Delete Layer") }, |
@@ -537,6 +539,18 @@ layer_dialog_new_callback(GtkWidget *widget, gpointer gdata) | ||
537 | 539 | } |
538 | 540 | |
539 | 541 | static void |
542 | +layer_dialog_rename_callback(GtkWidget *widget, gpointer gdata) | |
543 | +{ | |
544 | + GtkWidget *selected; | |
545 | + Diagram *dia; | |
546 | + Layer *layer; | |
547 | + dia = layer_dialog->diagram; | |
548 | + selected = GTK_LIST(layer_dialog->layer_list)->selection->data; | |
549 | + layer = dia->data->active_layer; | |
550 | + layer_dialog_edit_layer (DIA_LAYER_WIDGET (selected), dia, layer); | |
551 | +} | |
552 | + | |
553 | +static void | |
540 | 554 | layer_dialog_delete_callback(GtkWidget *widget, gpointer gdata) |
541 | 555 | { |
542 | 556 | Diagram *dia; |
@@ -823,7 +837,7 @@ layer_dialog_set_diagram(Diagram *dia) | ||
823 | 837 | /******* DiaLayerWidget: *****/ |
824 | 838 | |
825 | 839 | /* The connectability buttons don't quite behave the way they should. |
826 | - * The shift-click behaviour messes up the active layer. | |
840 | + * The shift-click behavior messes up the active layer. | |
827 | 841 | * To fix this, we need to rework the code so that the setting of |
828 | 842 | * connect_on and connect_off is not tied to the button toggling, |
829 | 843 | * but determined by what caused it (creation, user selection, |