http://bugzilla.gnome.org/show_bug.cgi?id=116710 be smarter about
2003-10-28 Jody Goldberg <jody@gnome.org> http://bugzilla.gnome.org/show_bug.cgi?id=116710 * main.c (cb_show_details) : be smarter about selecting a maximum
This commit is contained in:
parent
6abafab855
commit
00c200258d
2 changed files with 15 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
||||||
2003-10-28 Jody Goldberg <jody@gnome.org>
|
2003-10-28 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
|
http://bugzilla.gnome.org/show_bug.cgi?id=116710
|
||||||
|
* main.c (cb_show_details) : be smarter about selecting a maximum
|
||||||
|
|
||||||
http://bugzilla.gnome.org/show_bug.cgi?id=115435
|
http://bugzilla.gnome.org/show_bug.cgi?id=115435
|
||||||
* font-properties.glade : some of the UI review changes.
|
* font-properties.glade : some of the UI review changes.
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#ifdef HAVE_XFT2
|
#ifdef HAVE_XFT2
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
@ -806,6 +807,8 @@ cb_show_details (GtkWidget *button,
|
||||||
GladeXML *dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "render_details", NULL);
|
GladeXML *dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "render_details", NULL);
|
||||||
GtkWidget *dpi_spinner;
|
GtkWidget *dpi_spinner;
|
||||||
GnomeVFSURI *uri;
|
GnomeVFSURI *uri;
|
||||||
|
int dpi;
|
||||||
|
GtkAdjustment *adjustment;
|
||||||
|
|
||||||
details_dialog = WID ("render_details");
|
details_dialog = WID ("render_details");
|
||||||
uri = gnome_vfs_uri_new ("fonts:///");
|
uri = gnome_vfs_uri_new ("fonts:///");
|
||||||
|
@ -819,6 +822,15 @@ cb_show_details (GtkWidget *button,
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (details_dialog), parent);
|
gtk_window_set_transient_for (GTK_WINDOW (details_dialog), parent);
|
||||||
|
|
||||||
dpi_spinner = WID ("dpi_spinner");
|
dpi_spinner = WID ("dpi_spinner");
|
||||||
|
|
||||||
|
/* pick a sensible maximum dpi */
|
||||||
|
dpi = floor ((gdk_screen_width () / gdk_screen_width_mm () +
|
||||||
|
gdk_screen_height () / gdk_screen_height_mm ()) * 25.4 / 2. + .5);
|
||||||
|
if (dpi < 50)
|
||||||
|
dpi = 50; /* be extra careful */
|
||||||
|
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dpi_spinner));
|
||||||
|
adjustment->upper = dpi * 3;
|
||||||
|
|
||||||
dpi_load (client, GTK_SPIN_BUTTON (dpi_spinner));
|
dpi_load (client, GTK_SPIN_BUTTON (dpi_spinner));
|
||||||
g_signal_connect (dpi_spinner, "value_changed",
|
g_signal_connect (dpi_spinner, "value_changed",
|
||||||
G_CALLBACK (dpi_value_changed), client);
|
G_CALLBACK (dpi_value_changed), client);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue