st: Add high dpi support

Add a scale_factor property to StThemeContext that can
be used to enable (integer) scaling of pixel values.

https://bugzilla.gnome.org/show_bug.cgi?id=705410
This commit is contained in:
Adel Gadllah
2014-02-12 17:29:08 +01:00
parent 9f3499a7c3
commit d868e6bfaf
2 changed files with 83 additions and 1 deletions

View File

@ -1015,6 +1015,9 @@ get_length_from_term (StThemeNode *node,
} type = ABSOLUTE;
double multiplier = 1.0;
int scale_factor;
g_object_get (node->context, "scale-factor", &scale_factor, NULL);
if (term->type != TERM_NUMBER)
{
@ -1028,7 +1031,7 @@ get_length_from_term (StThemeNode *node,
{
case NUM_LENGTH_PX:
type = ABSOLUTE;
multiplier = 1;
multiplier = 1 * scale_factor;
break;
case NUM_LENGTH_PT:
type = POINTS;