Skip to content

Commit

Permalink
Fix formatting error in demo about dialogs
Browse files Browse the repository at this point in the history
Try harder to format things nicely.
  • Loading branch information
Matthias Clasen committed Nov 16, 2021
1 parent 0c53b60 commit 96778fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion demos/gtk-demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ activate_about (GSimpleAction *action,
glib_micro_version);
g_string_append_printf (s, "\tPango\t%s\n",
pango_version_string ());
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
Expand Down
2 changes: 1 addition & 1 deletion demos/icon-browser/iconbrowserapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ about_activated (GSimpleAction *action,
glib_micro_version);
g_string_append_printf (s, "\tPango\t%s\n",
pango_version_string ());
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
Expand Down
2 changes: 1 addition & 1 deletion demos/node-editor/node-editor-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ activate_about (GSimpleAction *action,
glib_micro_version);
g_string_append_printf (s, "\tPango\t%s\n",
pango_version_string ());
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
Expand Down
34 changes: 17 additions & 17 deletions demos/print-editor/print-editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ update_statusbar (void)
const char *print_str;

gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 0);

gtk_text_buffer_get_iter_at_mark (buffer,
&iter,
gtk_text_buffer_get_insert (buffer));
Expand All @@ -56,7 +56,7 @@ update_statusbar (void)
GtkPrintOperation *op = active_prints->data;
print_str = gtk_print_operation_get_status_string (op);
}

msg = g_strdup_printf ("%d, %d%s %s",
row, col,
file_changed?" - Modified":"",
Expand Down Expand Up @@ -188,10 +188,10 @@ save_file (GFile *save_filename)
"Error saving to file %s:\n%s",
display_name,
error->message);

g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (error_dialog);

g_error_free (error);
g_object_unref (info);
}
Expand Down Expand Up @@ -229,7 +229,7 @@ begin_print (GtkPrintOperation *operation,
pango_font_description_free (desc);

pango_layout_set_width (print_data->layout, width * PANGO_SCALE);

pango_layout_set_text (print_data->layout, print_data->text, -1);

num_lines = pango_layout_get_line_count (print_data->layout);
Expand All @@ -241,7 +241,7 @@ begin_print (GtkPrintOperation *operation,
{
PangoRectangle ink_rect, logical_rect;
double line_height;

layout_line = pango_layout_get_line (print_data->layout, line);
pango_layout_line_get_extents (layout_line, &ink_rect, &logical_rect);

Expand All @@ -258,7 +258,7 @@ begin_print (GtkPrintOperation *operation,

page_breaks = g_list_reverse (page_breaks);
gtk_print_operation_set_n_pages (operation, g_list_length (page_breaks) + 1);

print_data->page_breaks = page_breaks;
}

Expand Down Expand Up @@ -287,11 +287,11 @@ draw_page (GtkPrintOperation *operation,
end = pango_layout_get_line_count (print_data->layout);
else
end = GPOINTER_TO_INT (pagebreak->data);

cr = gtk_print_context_get_cairo_context (context);

cairo_set_source_rgb (cr, 0, 0, 0);

i = 0;
start_pos = 0;
iter = pango_layout_get_iter (print_data->layout);
Expand All @@ -307,12 +307,12 @@ draw_page (GtkPrintOperation *operation,

pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
baseline = pango_layout_iter_get_baseline (iter);

if (i == start)
start_pos = logical_rect.y / 1024.0;

cairo_move_to (cr, logical_rect.x / 1024.0, baseline / 1024.0 - start_pos);

pango_cairo_show_layout_line (cr, line);
}
i++;
Expand Down Expand Up @@ -383,9 +383,9 @@ print_done (GtkPrintOperation *op,
{

GtkWidget *error_dialog;

gtk_print_operation_get_error (op, &error);

error_dialog = gtk_message_dialog_new (GTK_WINDOW (main_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
Expand All @@ -405,13 +405,13 @@ print_done (GtkPrintOperation *op,
g_free (print_data->text);
g_free (print_data->font);
g_free (print_data);

if (!gtk_print_operation_is_finished (op))
{
g_object_ref (op);
active_prints = g_list_append (active_prints, op);
update_statusbar ();

/* This ref is unref:ed when we get the final state change */
g_signal_connect (op, "status_changed",
G_CALLBACK (status_changed_cb), NULL);
Expand Down Expand Up @@ -628,7 +628,7 @@ activate_about (GSimpleAction *action,
glib_micro_version);
g_string_append_printf (sysinfo, "\tPango\t%s\n",
pango_version_string ());
g_string_append_printf (sysinfo, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (sysinfo, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
Expand Down
2 changes: 1 addition & 1 deletion demos/widget-factory/widget-factory.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ activate_about (GSimpleAction *action,
glib_micro_version);
g_string_append_printf (s, "\tPango\t%s\n",
pango_version_string ());
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
Expand Down

0 comments on commit 96778fc

Please sign in to comment.