[gtk+/font-selection-new: 6/73] GtkFontSelection: Create alignment for the preview entry
- From: Alberto Ruiz <aruiz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/font-selection-new: 6/73] GtkFontSelection: Create alignment for the preview entry
- Date: Sat, 7 May 2011 18:12:44 +0000 (UTC)
commit fcbf4418b5f1dd0023a85a99f3b1122e393909bd
Author: Alberto Ruiz <aruiz gnome org>
Date: Fri Apr 15 22:18:14 2011 +0100
GtkFontSelection: Create alignment for the preview entry
gtk/gtkfontsel.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 7f79789..76df825 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -86,6 +86,7 @@ struct _GtkFontSelectionPrivate
GtkWidget *family_face_list;
GtkWidget *size_slider;
GtkWidget *size_spin;
+ GtkWidget *preview;
gint size;
PangoFontFace *face;
@@ -284,8 +285,10 @@ static void
gtk_font_selection_init (GtkFontSelection *fontsel)
{
GtkFontSelectionPrivate *priv;
- GtkWidget *scrolled_win;
- GList *focus_chain = NULL;
+
+ GtkWidget *scrolled_win;
+ GtkWidget *alignment;
+ GList *focus_chain = NULL;
AtkObject *atk_obj;
fontsel->priv = G_TYPE_INSTANCE_GET_PRIVATE (fontsel,
@@ -294,24 +297,33 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
priv = fontsel->priv;
gtk_widget_push_composite_child ();
+ /* Creating fundamental widgets for the private struct */
priv->search_entry = gtk_entry_new ();
priv->family_face_list = gtk_tree_view_new ();
+ priv->preview = gtk_entry_new ();
priv->size_slider = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
font_sizes[0],
font_sizes[(sizeof (font_sizes) /
sizeof (guint16)) - 1],
1);
priv->size_spin = gtk_spin_button_new_with_range (font_sizes[0],
- font_sizes[(sizeof (font_sizes) /
- sizeof (guint16)) - 1],
- 1);
-
+ font_sizes[(sizeof (font_sizes) /
+ sizeof (guint16)) - 1],
+ 1);
+ /* Main font family/face view */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_win), priv->family_face_list);
+ /* Alignment for the preview and size controls */
+ alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+ gtk_alignment_set_padding (alignment, 6, 0, 0, 0);
+
+
+
+
+ /* Packing everything in the selection */
gtk_box_pack_start (GTK_BOX (fontsel), priv->search_entry, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (fontsel), scrolled_win, TRUE, TRUE, 0);
-
priv->size = 12 * PANGO_SCALE;
priv->face = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]