[gtk+/wip/otte/gtk4: 31/127] filechooserwidget: Query dpi from CssStyle
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gtk4: 31/127] filechooserwidget: Query dpi from CssStyle
- Date: Sat, 8 Oct 2016 03:35:21 +0000 (UTC)
commit e39b1f44ced3b462a94bbe96118e7114713a075a
Author: Benjamin Otte <otte redhat com>
Date: Fri Sep 30 05:14:53 2016 +0200
filechooserwidget: Query dpi from CssStyle
gtk/gtkfilechooserwidget.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index be9d856..c236d51 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -30,6 +30,7 @@
#include "gtkcheckmenuitem.h"
#include "gtkclipboard.h"
#include "gtkcomboboxtext.h"
+#include "gtkcssnumbervalueprivate.h"
#include "gtkdragsource.h"
#include "gtkdragdest.h"
#include "gtkentry.h"
@@ -72,6 +73,7 @@
#include "gtkshow.h"
#include "gtkmain.h"
#include "gtkscrollable.h"
+#include "gtkstylecontextprivate.h"
#include "gtkpopover.h"
#include "gtkrevealer.h"
#include "gtkspinner.h"
@@ -6182,20 +6184,13 @@ find_good_size_from_style (GtkWidget *widget,
{
GtkStyleContext *context;
double font_size;
- GdkScreen *screen;
double resolution;
context = gtk_widget_get_style_context (widget);
- screen = gtk_widget_get_screen (widget);
- if (screen)
- {
- resolution = gdk_screen_get_resolution (screen);
- if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
- resolution = 96.0;
- }
- else
- resolution = 96.0; /* wheeee */
+ resolution = _gtk_css_number_value_get (_gtk_style_context_peek_property (context,
+ GTK_CSS_PROPERTY_DPI),
+ 100);
gtk_style_context_get (context,
gtk_style_context_get_state (context),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]