• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revisão89284a67bc36b26216b8d5aa0e99c95d50d211f3 (tree)
Hora2004-04-06 18:42:12
AutorLars Clausen <lclausen@src....>
CommiterLars Clausen

Mensagem de Log

Persistent linestyle

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
210
311 * app/recent_files.c: Use absolute name for recent files list.
412
--- a/app/interface.c
+++ b/app/interface.c
@@ -1111,6 +1111,8 @@ create_lineprops_area(GtkWidget *parent)
11111111 {
11121112 GtkWidget *chooser;
11131113 Arrow arrow;
1114+ real dash_length;
1115+ LineStyle style;
11141116
11151117 chooser = dia_arrow_chooser_new(TRUE, change_start_arrow_style, NULL, tool_tips);
11161118 gtk_wrap_box_pack_wrapped(GTK_WRAP_BOX(parent), chooser, FALSE, TRUE, FALSE, TRUE, TRUE);
@@ -1125,6 +1127,9 @@ create_lineprops_area(GtkWidget *parent)
11251127 chooser = dia_line_chooser_new(change_line_style, NULL);
11261128 gtk_wrap_box_pack(GTK_WRAP_BOX(parent), chooser, TRUE, TRUE, FALSE, TRUE);
11271129 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);
11281133 gtk_widget_show(chooser);
11291134
11301135 chooser = dia_arrow_chooser_new(FALSE, change_end_arrow_style, NULL, tool_tips);
--- a/lib/attributes.c
+++ b/lib/attributes.c
@@ -135,6 +135,8 @@ attributes_set_default_line_style(LineStyle style, real dash_length)
135135 {
136136 attributes_linestyle = style;
137137 attributes_dash_length = dash_length;
138+ persistence_set_integer("line-style", style);
139+ persistence_set_real("dash-length", dash_length);
138140 }
139141
140142 void
--- a/lib/dialinechooser.c
+++ b/lib/dialinechooser.c
@@ -258,15 +258,24 @@ dia_line_chooser_change_line_style(GtkMenuItem *mi, DiaLineChooser *lchooser)
258258 LineStyle lstyle = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mi),
259259 menuitem_enum_key));
260260
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) {
262270 dia_line_preview_set(lchooser->preview, lstyle);
263271 lchooser->lstyle = lstyle;
264272 dia_line_style_selector_set_linestyle(lchooser->selector, lchooser->lstyle,
265273 lchooser->dash_length);
266- if (lchooser->callback)
267- (* lchooser->callback)(lchooser->lstyle, lchooser->dash_length,
268- lchooser->user_data);
269274 }
275+ lchooser->dash_length = dashlength;
276+ if (lchooser->callback)
277+ (* lchooser->callback)(lchooser->lstyle, lchooser->dash_length,
278+ lchooser->user_data);
270279 }
271280
272281 static void
--- a/lib/dialinechooser.h
+++ b/lib/dialinechooser.h
@@ -88,7 +88,9 @@ struct _DiaLineChooserClass
8888 GtkButtonClass parent_class;
8989 };
9090
91-
91+void dia_line_chooser_set_line_style(DiaLineChooser *lchooser,
92+ LineStyle style,
93+ real dashlength);
9294 GtkWidget *dia_line_chooser_new (DiaChangeLineCallback callback,
9395 gpointer user_data);
9496