作図ソフト dia の改良版
Révision | 89284a67bc36b26216b8d5aa0e99c95d50d211f3 (tree) |
---|---|
l'heure | 2004-04-06 18:42:12 |
Auteur | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Persistent linestyle
@@ -1,4 +1,12 @@ | ||
1 | -2004-04-02 Lars Clausen <lc@pc770.sb.statsbiblioteket.dk> | |
1 | +2004-04-06 Lars Clausen <lars@raeder.dk> | |
2 | + | |
3 | + * lib/dialinechooser.[ch] (dia_line_chooser_set_line_style): | |
4 | + * lib/attributes.c (attributes_set_default_line_style): | |
5 | + * app/interface.c (create_lineprops_area): | |
6 | + Make line style persistent as well. Added function to directly | |
7 | + set the style and dashlength of a dialinechooser. | |
8 | + | |
9 | +2004-04-02 Lars Clausen <lars@raeder.dk> | |
2 | 10 | |
3 | 11 | * app/recent_files.c: Use absolute name for recent files list. |
4 | 12 |
@@ -1111,6 +1111,8 @@ create_lineprops_area(GtkWidget *parent) | ||
1111 | 1111 | { |
1112 | 1112 | GtkWidget *chooser; |
1113 | 1113 | Arrow arrow; |
1114 | + real dash_length; | |
1115 | + LineStyle style; | |
1114 | 1116 | |
1115 | 1117 | chooser = dia_arrow_chooser_new(TRUE, change_start_arrow_style, NULL, tool_tips); |
1116 | 1118 | gtk_wrap_box_pack_wrapped(GTK_WRAP_BOX(parent), chooser, FALSE, TRUE, FALSE, TRUE, TRUE); |
@@ -1125,6 +1127,9 @@ create_lineprops_area(GtkWidget *parent) | ||
1125 | 1127 | chooser = dia_line_chooser_new(change_line_style, NULL); |
1126 | 1128 | gtk_wrap_box_pack(GTK_WRAP_BOX(parent), chooser, TRUE, TRUE, FALSE, TRUE); |
1127 | 1129 | gtk_tooltips_set_tip(tool_tips, chooser, _("Line style for new lines. Click to pick a line style, or set line style parameters with Details..."), NULL); |
1130 | + style = persistence_register_integer("line-style", LINESTYLE_SOLID); | |
1131 | + dash_length = persistence_register_real("dash-length", DEFAULT_LINESTYLE_DASHLEN); | |
1132 | + dia_line_chooser_set_line_style(chooser, style, dash_length); | |
1128 | 1133 | gtk_widget_show(chooser); |
1129 | 1134 | |
1130 | 1135 | chooser = dia_arrow_chooser_new(FALSE, change_end_arrow_style, NULL, tool_tips); |
@@ -135,6 +135,8 @@ attributes_set_default_line_style(LineStyle style, real dash_length) | ||
135 | 135 | { |
136 | 136 | attributes_linestyle = style; |
137 | 137 | attributes_dash_length = dash_length; |
138 | + persistence_set_integer("line-style", style); | |
139 | + persistence_set_real("dash-length", dash_length); | |
138 | 140 | } |
139 | 141 | |
140 | 142 | void |
@@ -258,15 +258,24 @@ dia_line_chooser_change_line_style(GtkMenuItem *mi, DiaLineChooser *lchooser) | ||
258 | 258 | LineStyle lstyle = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mi), |
259 | 259 | menuitem_enum_key)); |
260 | 260 | |
261 | - if (lchooser->lstyle != lstyle) { | |
261 | + dia_line_chooser_set_line_style(lchooser, lstyle, lchooser->dash_length); | |
262 | +} | |
263 | + | |
264 | +void | |
265 | +dia_line_chooser_set_line_style(DiaLineChooser *lchooser, | |
266 | + LineStyle lstyle, | |
267 | + real dashlength) | |
268 | +{ | |
269 | + if (lstyle != lchooser->lstyle) { | |
262 | 270 | dia_line_preview_set(lchooser->preview, lstyle); |
263 | 271 | lchooser->lstyle = lstyle; |
264 | 272 | dia_line_style_selector_set_linestyle(lchooser->selector, lchooser->lstyle, |
265 | 273 | lchooser->dash_length); |
266 | - if (lchooser->callback) | |
267 | - (* lchooser->callback)(lchooser->lstyle, lchooser->dash_length, | |
268 | - lchooser->user_data); | |
269 | 274 | } |
275 | + lchooser->dash_length = dashlength; | |
276 | + if (lchooser->callback) | |
277 | + (* lchooser->callback)(lchooser->lstyle, lchooser->dash_length, | |
278 | + lchooser->user_data); | |
270 | 279 | } |
271 | 280 | |
272 | 281 | static void |
@@ -88,7 +88,9 @@ struct _DiaLineChooserClass | ||
88 | 88 | GtkButtonClass parent_class; |
89 | 89 | }; |
90 | 90 | |
91 | - | |
91 | +void dia_line_chooser_set_line_style(DiaLineChooser *lchooser, | |
92 | + LineStyle style, | |
93 | + real dashlength); | |
92 | 94 | GtkWidget *dia_line_chooser_new (DiaChangeLineCallback callback, |
93 | 95 | gpointer user_data); |
94 | 96 |