Import newer upstream.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* a rebranding of The GNU Image Manipulation Program (created with heckimp)
|
||||
* A derived work which may be trivial. However, any changes may be (C)2023 by Aldercone Studio
|
||||
*
|
||||
* Original copyright, applying to most contents (license remains unchanged):
|
||||
* Original copyright, applying to most contents (license remains unchanged):
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@ -45,13 +45,6 @@
|
||||
#include "pika-intl.h"
|
||||
|
||||
|
||||
/* The first authors are the creators and maintainers, don't shuffle
|
||||
* them
|
||||
*/
|
||||
#define START_INDEX (G_N_ELEMENTS (creators) - 1 /*NULL*/ + \
|
||||
G_N_ELEMENTS (maintainers) - 1 /*NULL*/)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
@ -62,9 +55,6 @@ typedef struct
|
||||
GtkWidget *anim_area;
|
||||
PangoLayout *layout;
|
||||
|
||||
gint n_authors;
|
||||
gint shuffle[G_N_ELEMENTS (authors) - 1]; /* NULL terminated */
|
||||
|
||||
guint timer;
|
||||
|
||||
gint index;
|
||||
@ -116,7 +106,6 @@ about_dialog_create (PikaCoreConfig *config)
|
||||
gchar *copyright;
|
||||
gchar *version;
|
||||
|
||||
dialog.n_authors = G_N_ELEMENTS (authors) - 1;
|
||||
dialog.config = config;
|
||||
|
||||
pixbuf = about_dialog_load_logo ();
|
||||
@ -145,9 +134,6 @@ about_dialog_create (PikaCoreConfig *config)
|
||||
"logo", pixbuf,
|
||||
"website", "https://heckin.technology/AlderconeStudio/PIKApp/",
|
||||
"website-label", _("Visit the PIKA website"),
|
||||
"authors", authors,
|
||||
"artists", artists,
|
||||
"documenters", documenters,
|
||||
/* Translators: insert your names here,
|
||||
separated by newline */
|
||||
"translator-credits", _("translator-credits"),
|
||||
@ -480,27 +466,6 @@ about_dialog_add_update (PikaAboutDialog *dialog,
|
||||
static void
|
||||
about_dialog_reshuffle (PikaAboutDialog *dialog)
|
||||
{
|
||||
GRand *gr = g_rand_new ();
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < dialog->n_authors; i++)
|
||||
dialog->shuffle[i] = i;
|
||||
|
||||
for (i = START_INDEX; i < dialog->n_authors; i++)
|
||||
{
|
||||
gint j = g_rand_int_range (gr, START_INDEX, dialog->n_authors);
|
||||
|
||||
if (i != j)
|
||||
{
|
||||
gint t;
|
||||
|
||||
t = dialog->shuffle[j];
|
||||
dialog->shuffle[j] = dialog->shuffle[i];
|
||||
dialog->shuffle[i] = t;
|
||||
}
|
||||
}
|
||||
|
||||
g_rand_free (gr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -677,17 +642,11 @@ about_dialog_timer (gpointer data)
|
||||
return FALSE;
|
||||
|
||||
case 1:
|
||||
text = insert_spacers (_("PIKA is brought to you by"));
|
||||
dialog->state += 1;
|
||||
text = insert_spacers (_("PIKA is brought to you by Aldercone Studio"));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (! (dialog->index < dialog->n_authors))
|
||||
dialog->index = 0;
|
||||
|
||||
text = insert_spacers (authors[dialog->shuffle[dialog->index]]);
|
||||
dialog->index += 1;
|
||||
break;
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
g_return_val_if_reached (TRUE);
|
||||
|
@ -159,6 +159,11 @@ static void prefs_gui_config_notify_icon_size (GObject *config,
|
||||
GtkRange *range);
|
||||
static void prefs_icon_size_value_changed (GtkRange *range,
|
||||
PikaGuiConfig *config);
|
||||
static void prefs_gui_config_notify_font_size (GObject *config,
|
||||
GParamSpec *pspec,
|
||||
GtkRange *range);
|
||||
static void prefs_font_size_value_changed (GtkRange *range,
|
||||
PikaGuiConfig *config);
|
||||
|
||||
|
||||
/* private variables */
|
||||
@ -975,6 +980,38 @@ prefs_gui_config_notify_icon_size (GObject *config,
|
||||
config);
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_font_size_value_changed (GtkRange *range,
|
||||
PikaGuiConfig *config)
|
||||
{
|
||||
gdouble value = gtk_range_get_value (range);
|
||||
|
||||
g_signal_handlers_block_by_func (config,
|
||||
G_CALLBACK (prefs_gui_config_notify_font_size),
|
||||
range);
|
||||
g_object_set (G_OBJECT (config),
|
||||
"font-relative-size", value / 100.0,
|
||||
NULL);
|
||||
g_signal_handlers_unblock_by_func (config,
|
||||
G_CALLBACK (prefs_gui_config_notify_font_size),
|
||||
range);
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_gui_config_notify_font_size (GObject *config,
|
||||
GParamSpec *pspec,
|
||||
GtkRange *range)
|
||||
{
|
||||
g_signal_handlers_block_by_func (range,
|
||||
G_CALLBACK (prefs_font_size_value_changed),
|
||||
config);
|
||||
gtk_range_set_value (range,
|
||||
PIKA_GUI_CONFIG (config)->font_relative_size * 100.0);
|
||||
g_signal_handlers_unblock_by_func (range,
|
||||
G_CALLBACK (prefs_font_size_value_changed),
|
||||
config);
|
||||
}
|
||||
|
||||
static void
|
||||
prefs_format_string_select_callback (GtkListBox *listbox,
|
||||
GtkListBoxRow *row,
|
||||
@ -2116,6 +2153,31 @@ prefs_dialog_new (Pika *pika,
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* Font sizes. */
|
||||
vbox3 = prefs_frame_new (_("Font Scaling"), GTK_CONTAINER (vbox2), FALSE);
|
||||
pika_help_set_help_data (vbox3,
|
||||
_("Font scaling will not work with themes using absolute sizes."),
|
||||
NULL);
|
||||
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
|
||||
50, 200, 10);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_BOTTOM);
|
||||
gtk_scale_add_mark (GTK_SCALE (scale), 50.0, GTK_POS_BOTTOM,
|
||||
_("50%"));
|
||||
gtk_scale_add_mark (GTK_SCALE (scale), 100.0, GTK_POS_BOTTOM,
|
||||
_("100%"));
|
||||
gtk_scale_add_mark (GTK_SCALE (scale), 200.0, GTK_POS_BOTTOM,
|
||||
_("200%"));
|
||||
gtk_range_set_value (GTK_RANGE (scale),
|
||||
(gdouble) PIKA_GUI_CONFIG (object)->font_relative_size * 100.0);
|
||||
g_signal_connect (G_OBJECT (scale), "value-changed",
|
||||
G_CALLBACK (prefs_font_size_value_changed),
|
||||
PIKA_GUI_CONFIG (object));
|
||||
g_signal_connect (G_OBJECT (object), "notify::font-relative-size",
|
||||
G_CALLBACK (prefs_gui_config_notify_font_size),
|
||||
scale);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* Reload Current Theme button */
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
||||
|
Reference in New Issue
Block a user