2013-03-05 14:23:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Nokia Corporation.
|
|
|
|
* Author: Xan Lopez <xan.lopez@nokia.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
|
|
* version 2.1 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2020-03-06 17:05:43 +00:00
|
|
|
static const char *baseline_pos_str[] = {
|
2013-03-05 14:23:31 +00:00
|
|
|
"BASELINE_POSITION_TOP",
|
|
|
|
"BASELINE_POSITION_CENTER",
|
|
|
|
"BASELINE_POSITION_BOTTOM"
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
baseline_row_value_changed (GtkSpinButton *spin_button,
|
|
|
|
GtkGrid *grid)
|
|
|
|
{
|
|
|
|
gint row = gtk_spin_button_get_value_as_int (spin_button);
|
|
|
|
|
|
|
|
gtk_grid_set_baseline_row (grid, row);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
homogeneous_changed (GtkToggleButton *toggle_button,
|
|
|
|
GtkGrid *grid)
|
|
|
|
{
|
|
|
|
gtk_grid_set_row_homogeneous (grid, gtk_toggle_button_get_active (toggle_button));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
baseline_position_changed (GtkComboBox *combo,
|
|
|
|
GtkBox *hbox)
|
|
|
|
{
|
|
|
|
int i = gtk_combo_box_get_active (combo);
|
|
|
|
|
|
|
|
gtk_box_set_baseline_position (hbox, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
image_size_value_changed (GtkSpinButton *spin_button,
|
|
|
|
GtkImage *image)
|
|
|
|
{
|
|
|
|
gint size = gtk_spin_button_get_value_as_int (spin_button);
|
|
|
|
|
|
|
|
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
|
|
|
}
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
static void
|
|
|
|
set_font_size (GtkWidget *widget, gint size)
|
|
|
|
{
|
|
|
|
const gchar *class[3] = { "small-font", "medium-font", "large-font" };
|
|
|
|
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (widget, class[size]);
|
2014-10-08 02:04:26 +00:00
|
|
|
}
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
static void
|
|
|
|
quit_cb (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean *done = data;
|
|
|
|
|
|
|
|
*done = TRUE;
|
|
|
|
|
|
|
|
g_main_context_wakeup (NULL);
|
|
|
|
}
|
|
|
|
|
2013-03-05 14:23:31 +00:00
|
|
|
int
|
|
|
|
main (int argc,
|
|
|
|
char **argv)
|
|
|
|
{
|
|
|
|
GtkWidget *window, *label, *entry, *button, *grid, *notebook;
|
2017-08-01 22:49:42 +00:00
|
|
|
GtkWidget *vbox, *hbox, *grid_hbox, *spin, *spin2, *toggle, *combo, *image;
|
2013-03-05 14:23:31 +00:00
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
int i, j;
|
2014-10-08 02:04:26 +00:00
|
|
|
GtkCssProvider *provider;
|
2020-02-10 03:24:47 +00:00
|
|
|
gboolean done = FALSE;
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2016-12-28 13:53:22 +00:00
|
|
|
gtk_init ();
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
provider = gtk_css_provider_new ();
|
|
|
|
gtk_css_provider_load_from_data (provider,
|
|
|
|
".small-font { font-size: 5px; }"
|
|
|
|
".medium-font { font-size: 10px; }"
|
2016-10-17 14:09:12 +00:00
|
|
|
".large-font { font-size: 15px; }", -1);
|
2017-10-31 01:35:21 +00:00
|
|
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
|
|
|
GTK_STYLE_PROVIDER (provider),
|
|
|
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
2014-10-08 02:04:26 +00:00
|
|
|
g_object_unref (provider);
|
2020-02-14 19:55:36 +00:00
|
|
|
window = gtk_window_new ();
|
2020-02-10 03:24:47 +00:00
|
|
|
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (quit_cb), &done);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
notebook = gtk_notebook_new ();
|
2020-05-02 21:26:54 +00:00
|
|
|
gtk_window_set_child (GTK_WINDOW (window), notebook);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2016-10-02 15:37:22 +00:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
2013-03-05 14:23:31 +00:00
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
vbox, gtk_label_new ("hboxes"));
|
|
|
|
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
{
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2020-03-06 17:05:43 +00:00
|
|
|
const char *aligns_names[] = { "FILL", "BASELINE" };
|
2013-03-05 14:23:31 +00:00
|
|
|
GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE};
|
|
|
|
|
|
|
|
label = gtk_label_new (aligns_names[j]);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), label);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
label = gtk_label_new ("│XYyj,Ö...");
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (label, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
gtk_widget_set_valign (label, aligns[j]);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), label);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "│XYyj,Ö...");
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (entry, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
gtk_widget_set_valign (entry, aligns[j]);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), entry);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
spin = gtk_spin_button_new (NULL, 0, 1);
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (spin), GTK_ORIENTATION_VERTICAL);
|
|
|
|
gtk_widget_set_valign (spin, aligns[j]);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), spin);
|
2017-06-27 12:36:29 +00:00
|
|
|
|
|
|
|
spin = gtk_spin_button_new (NULL, 0, 1);
|
|
|
|
gtk_widget_set_valign (spin, aligns[j]);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), spin);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
combo = gtk_combo_box_text_new ();
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[0]);
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[1]);
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[2]);
|
|
|
|
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 1);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), combo);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
{
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (combo), "changed",
|
|
|
|
G_CALLBACK (baseline_position_changed), hbox);
|
|
|
|
|
|
|
|
if (j == 0)
|
|
|
|
label = gtk_label_new ("Baseline:");
|
|
|
|
else
|
|
|
|
label = gtk_label_new ("Normal:");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), label);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
button = gtk_button_new_with_label ("│Xyj,Ö");
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (button, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
2016-10-14 14:01:56 +00:00
|
|
|
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
|
|
|
button = gtk_button_new ();
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (box), gtk_label_new ("│Xyj,Ö"));
|
|
|
|
gtk_box_append (GTK_BOX (box), gtk_image_new_from_icon_name ("face-sad"));
|
2020-05-02 07:05:19 +00:00
|
|
|
gtk_button_set_child (GTK_BUTTON (button), box);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (button, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
2017-11-15 00:43:13 +00:00
|
|
|
image = gtk_image_new_from_icon_name ("face-sad");
|
2013-03-05 14:23:31 +00:00
|
|
|
gtk_image_set_pixel_size (GTK_IMAGE (image), 34);
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (image, GTK_ALIGN_BASELINE);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), image);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
button = gtk_toggle_button_new_with_label ("│Xyj,Ö");
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
button = gtk_toggle_button_new_with_label ("│Xyj,Ö");
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label ("│Xyj,Ö");
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
button = gtk_radio_button_new_with_label (NULL, "│Xyj,Ö");
|
|
|
|
if (j == 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
vbox, gtk_label_new ("grid"));
|
|
|
|
|
|
|
|
grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
label = gtk_label_new ("Align me:");
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), label);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
grid = gtk_grid_new ();
|
|
|
|
gtk_widget_set_valign (grid, GTK_ALIGN_BASELINE);
|
|
|
|
gtk_grid_set_column_spacing (GTK_GRID (grid), 8);
|
|
|
|
gtk_grid_set_row_spacing (GTK_GRID (grid), 8);
|
|
|
|
|
|
|
|
for (j = 0; j < 4; j++)
|
|
|
|
{
|
2020-03-06 17:05:43 +00:00
|
|
|
const char *labels[] = { "Normal:", "Baseline (top):", "Baseline (center):", "Baseline (bottom):"};
|
2013-03-05 14:23:31 +00:00
|
|
|
label = gtk_label_new (labels[j]);
|
|
|
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid),
|
|
|
|
label,
|
|
|
|
0, j,
|
|
|
|
1, 1);
|
|
|
|
gtk_widget_set_vexpand (label, TRUE);
|
|
|
|
|
|
|
|
if (j != 0)
|
|
|
|
gtk_grid_set_row_baseline_position (GTK_GRID (grid),
|
|
|
|
j, (GtkBaselinePosition)(j-1));
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
label = gtk_label_new ("Xyjg,Ö.");
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (label, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (j != 0)
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
|
|
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid),
|
|
|
|
label,
|
|
|
|
i+1, j,
|
|
|
|
1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
2016-10-14 14:01:56 +00:00
|
|
|
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
|
|
|
button = gtk_button_new ();
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (box), gtk_label_new ("│Xyj,Ö"));
|
|
|
|
gtk_box_append (GTK_BOX (box), gtk_image_new_from_icon_name ("face-sad"));
|
2020-05-02 07:05:19 +00:00
|
|
|
gtk_button_set_child (GTK_BUTTON (button), box);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (button, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (j != 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
|
|
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid),
|
|
|
|
button,
|
|
|
|
i+4, j,
|
|
|
|
1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), grid);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
adjustment = gtk_adjustment_new (0.0, -1.0, 5.0, 1.0, 1.0, 0.0);
|
|
|
|
spin = gtk_spin_button_new (adjustment, 1.0, 0);
|
|
|
|
g_signal_connect (spin, "value-changed", (GCallback)baseline_row_value_changed, grid);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), spin);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
toggle = gtk_toggle_button_new_with_label ("Homogeneous");
|
|
|
|
g_signal_connect (toggle, "toggled", (GCallback)homogeneous_changed, grid);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), toggle);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
combo = gtk_combo_box_text_new ();
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[0]);
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[1]);
|
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[2]);
|
|
|
|
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 1);
|
|
|
|
g_signal_connect (G_OBJECT (combo), "changed",
|
|
|
|
G_CALLBACK (baseline_position_changed), grid_hbox);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), combo);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
vbox, gtk_label_new ("button box"));
|
|
|
|
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
adjustment = gtk_adjustment_new (34.0, 1.0, 64.0, 1.0, 1.0, 0.0);
|
|
|
|
spin = gtk_spin_button_new (adjustment, 1.0, 0);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), spin);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
adjustment = gtk_adjustment_new (16.0, 1.0, 64.0, 1.0, 1.0, 0.0);
|
|
|
|
spin2 = gtk_spin_button_new (adjustment, 1.0, 0);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), spin2);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
for (j = 0; j < 3; j++)
|
|
|
|
{
|
2019-02-04 17:44:55 +00:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (vbox), hbox);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
gtk_box_set_baseline_position (GTK_BOX (hbox), j);
|
|
|
|
|
|
|
|
label = gtk_label_new (baseline_pos_str[j]);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), label);
|
2013-03-05 14:23:31 +00:00
|
|
|
gtk_widget_set_vexpand (label, TRUE);
|
|
|
|
|
2017-11-15 00:43:13 +00:00
|
|
|
image = gtk_image_new_from_icon_name ("face-sad");
|
2013-03-05 14:23:31 +00:00
|
|
|
gtk_image_set_pixel_size (GTK_IMAGE (image), 34);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), image);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
g_signal_connect (spin, "value-changed", (GCallback)image_size_value_changed, image);
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
button = gtk_button_new_with_label ("│Xyj,Ö");
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (button, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (i != 0)
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
2016-10-14 14:01:56 +00:00
|
|
|
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
|
|
|
button = gtk_button_new ();
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (box), gtk_label_new ("│Xyj,Ö"));
|
2017-11-15 00:43:13 +00:00
|
|
|
image = gtk_image_new_from_icon_name ("face-sad");
|
2016-10-14 14:01:56 +00:00
|
|
|
gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (box), image);
|
2020-05-02 07:05:19 +00:00
|
|
|
gtk_button_set_child (GTK_BUTTON (button), box);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
if (i == 0)
|
|
|
|
g_signal_connect (spin2, "value-changed", (GCallback)image_size_value_changed, image);
|
|
|
|
|
2014-10-08 02:04:26 +00:00
|
|
|
set_font_size (button, i);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (hbox), button);
|
2013-03-05 14:23:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-19 09:02:04 +00:00
|
|
|
gtk_widget_show (window);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
while (!done)
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2013-03-05 14:23:31 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|