Layout Preview window position is saved/restored
This commit is contained in:
parent
d48a56d59f
commit
c5b51f49b2
3 changed files with 72 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-04-22 Sergey Udaltsov <svu@gnome.org>
|
||||||
|
|
||||||
|
gnome-keyboard-properties-xkblt.c:
|
||||||
|
Layout Preview window saves/restores geometry
|
||||||
|
|
||||||
2006-03-02 Sergey Udaltsov <svu@gnome.org>
|
2006-03-02 Sergey Udaltsov <svu@gnome.org>
|
||||||
|
|
||||||
Fixes #336396
|
Fixes #336396
|
||||||
|
|
|
@ -521,6 +521,8 @@ xkb_layout_chooser_response(GtkDialog *dialog,
|
||||||
gint response,
|
gint response,
|
||||||
GladeXML *chooserDialog)
|
GladeXML *chooserDialog)
|
||||||
{
|
{
|
||||||
|
GdkRectangle rect;
|
||||||
|
|
||||||
if (response == GTK_RESPONSE_OK)
|
if (response == GTK_RESPONSE_OK)
|
||||||
{
|
{
|
||||||
GtkTreeSelection *selection =
|
GtkTreeSelection *selection =
|
||||||
|
@ -573,6 +575,10 @@ xkb_layout_chooser_response(GtkDialog *dialog,
|
||||||
clear_xkb_elements_list (layoutsList);
|
clear_xkb_elements_list (layoutsList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_window_get_position (GTK_WINDOW (dialog), &rect.x, &rect.y);
|
||||||
|
gtk_window_get_size (GTK_WINDOW (dialog), &rect.width, &rect.height);
|
||||||
|
GSwitchItPreviewSave (&rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -598,6 +604,7 @@ xkb_layout_choose (GladeXML * dialog)
|
||||||
GladeXML* chooserDialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-keyboard-properties.glade", "xkb_layout_chooser", NULL);
|
GladeXML* chooserDialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-keyboard-properties.glade", "xkb_layout_chooser", NULL);
|
||||||
GtkWidget* chooser = CWID ( "xkb_layout_chooser");
|
GtkWidget* chooser = CWID ( "xkb_layout_chooser");
|
||||||
GtkWidget* kbdraw = NULL;
|
GtkWidget* kbdraw = NULL;
|
||||||
|
GtkWidget* toplevel = NULL;
|
||||||
|
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog")));
|
gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog")));
|
||||||
|
|
||||||
|
@ -620,6 +627,18 @@ xkb_layout_choose (GladeXML * dialog)
|
||||||
g_signal_connect (G_OBJECT (chooser),
|
g_signal_connect (G_OBJECT (chooser),
|
||||||
"response", G_CALLBACK (xkb_layout_chooser_response), chooserDialog);
|
"response", G_CALLBACK (xkb_layout_chooser_response), chooserDialog);
|
||||||
|
|
||||||
|
toplevel = gtk_widget_get_toplevel (chooser);
|
||||||
|
if (GTK_WIDGET_TOPLEVEL (toplevel))
|
||||||
|
{
|
||||||
|
GdkRectangle *rect = GSwitchItPreviewLoad ();
|
||||||
|
if (rect != NULL)
|
||||||
|
{
|
||||||
|
gtk_window_move (GTK_WINDOW (toplevel), rect->x, rect->y);
|
||||||
|
gtk_window_resize (GTK_WINDOW (toplevel), rect->width, rect->height);
|
||||||
|
g_free (rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gtk_dialog_run (GTK_DIALOG (chooser));
|
gtk_dialog_run (GTK_DIALOG (chooser));
|
||||||
gtk_widget_destroy (chooser);
|
gtk_widget_destroy (chooser);
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,5 +141,53 @@
|
||||||
</locale>
|
</locale>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/gswitchit/preview/x</key>
|
||||||
|
<applyto>/apps/gswitchit/preview/x</applyto>
|
||||||
|
<owner>gnome</owner>
|
||||||
|
<type>int</type>
|
||||||
|
<default>-1</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>The Keyboard Preview, X offset</short>
|
||||||
|
<long>The Keyboard Preview, X offset</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/gswitchit/preview/y</key>
|
||||||
|
<applyto>/apps/gswitchit/preview/y</applyto>
|
||||||
|
<owner>gnome</owner>
|
||||||
|
<type>int</type>
|
||||||
|
<default>-1</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>The Keyboard Preview, Y offset</short>
|
||||||
|
<long>The Keyboard Preview, Y offset</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/gswitchit/preview/width</key>
|
||||||
|
<applyto>/apps/gswitchit/preview/width</applyto>
|
||||||
|
<owner>gnome</owner>
|
||||||
|
<type>int</type>
|
||||||
|
<default>-1</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>The Keyboard Preview, width</short>
|
||||||
|
<long>The Keyboard Preview, width</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
|
<schema>
|
||||||
|
<key>/schemas/apps/gswitchit/preview/height</key>
|
||||||
|
<applyto>/apps/gswitchit/preview/height</applyto>
|
||||||
|
<owner>gnome</owner>
|
||||||
|
<type>int</type>
|
||||||
|
<default>-1</default>
|
||||||
|
<locale name="C">
|
||||||
|
<short>The Keyboard Preview, height</short>
|
||||||
|
<long>The Keyboard Preview, height</long>
|
||||||
|
</locale>
|
||||||
|
</schema>
|
||||||
|
|
||||||
</schemalist>
|
</schemalist>
|
||||||
</gconfschemafile>
|
</gconfschemafile>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue