diff options
| -rw-r--r-- | unity-private/launcher/quicklist-controller.vala | 2 | ||||
| -rw-r--r-- | unity-private/launcher/quicklist-view.vala | 12 | ||||
| -rw-r--r-- | unity/quicklist-rendering.vala | 36 |
3 files changed, 39 insertions, 11 deletions
diff --git a/unity-private/launcher/quicklist-controller.vala b/unity-private/launcher/quicklist-controller.vala index afefc1076..3c3e66bf3 100644 --- a/unity-private/launcher/quicklist-controller.vala +++ b/unity-private/launcher/quicklist-controller.vala @@ -84,7 +84,7 @@ namespace Unity.Launcher float x; float y; this.menu.get_position (out x, out y); - this.menu.set_position (x - (float) 20.0f, y - 4.0f); + this.menu.set_position (x - (float) 22.0f, y - 1.0f); this.is_in_label = true; } diff --git a/unity-private/launcher/quicklist-view.vala b/unity-private/launcher/quicklist-view.vala index a927a507f..e1f049220 100644 --- a/unity-private/launcher/quicklist-view.vala +++ b/unity-private/launcher/quicklist-view.vala @@ -29,15 +29,15 @@ namespace Unity.Launcher const float MARGIN = 0.5f; const float BORDER = 0.25f; const float CORNER_RADIUS = 0.3f; - const float CORNER_RADIUS_ABS = 8.0f; + const float CORNER_RADIUS_ABS = 5.0f; const float SHADOW_SIZE = 1.25f; const float ITEM_HEIGHT = 2.0f; const float ITEM_CORNER_RADIUS = 0.3f; - const float ITEM_CORNER_RADIUS_ABS = 6.0f; + const float ITEM_CORNER_RADIUS_ABS = 4.0f; const float ANCHOR_HEIGHT = 1.5f; - const float ANCHOR_HEIGHT_ABS = 14.0f; + const float ANCHOR_HEIGHT_ABS = 18.0f; const float ANCHOR_WIDTH = 0.75f; - const float ANCHOR_WIDTH_ABS = 8.0f; + const float ANCHOR_WIDTH_ABS = 10.0f; // we subclass Ctk.MenuSeperator here because we need to adapt it's appearance public class QuicklistMenuSeperator : Ctk.MenuSeperator @@ -459,9 +459,9 @@ namespace Unity.Launcher { Ctk.Padding padding = Ctk.Padding () { left = (int) (Ctk.em_to_pixel (BORDER + SHADOW_SIZE) + ANCHOR_WIDTH_ABS), - right = (int) Ctk.em_to_pixel (BORDER + SHADOW_SIZE), + right = (int) Ctk.em_to_pixel (BORDER + SHADOW_SIZE) - 1, top = (int) Ctk.em_to_pixel (BORDER + SHADOW_SIZE), - bottom = (int) Ctk.em_to_pixel (BORDER + SHADOW_SIZE) + bottom = (int) Ctk.em_to_pixel (SHADOW_SIZE) + 1 }; this.set_padding (padding); //this.spacing = (int) Ctk.em_to_pixel (GAP); diff --git a/unity/quicklist-rendering.vala b/unity/quicklist-rendering.vala index 1a074b8e4..f4ce49b4c 100644 --- a/unity/quicklist-rendering.vala +++ b/unity/quicklist-rendering.vala @@ -30,15 +30,15 @@ namespace Unity.QuicklistRendering const float MARGIN = 0.5f; const float BORDER = 0.25f; const float CORNER_RADIUS = 0.3f; - const float CORNER_RADIUS_ABS = 8.0f; + const float CORNER_RADIUS_ABS = 5.0f; const float SHADOW_SIZE = 1.25f; const float ITEM_HEIGHT = 2.0f; const float ITEM_CORNER_RADIUS = 0.3f; - const float ITEM_CORNER_RADIUS_ABS = 6.0f; + const float ITEM_CORNER_RADIUS_ABS = 4.0f; const float ANCHOR_HEIGHT = 1.5f; - const float ANCHOR_HEIGHT_ABS = 14.0f; + const float ANCHOR_HEIGHT_ABS = 18.0f; const float ANCHOR_WIDTH = 0.75f; - const float ANCHOR_WIDTH_ABS = 8.0f; + const float ANCHOR_WIDTH_ABS = 10.0f; public class Seperator : GLib.Object { @@ -150,12 +150,21 @@ namespace Unity.QuicklistRendering Cairo.Surface surface = new Cairo.ImageSurface (Cairo.Format.A1, 1, 1); Cairo.Context cr = new Cairo.Context (surface); Pango.Layout layout = Pango.cairo_create_layout (cr); + Gtk.Settings settings = Gtk.Settings.get_default (); Pango.FontDescription desc = Pango.FontDescription.from_string (font); desc.set_weight (Pango.Weight.NORMAL); layout.set_font_description (desc); layout.set_wrap (Pango.WrapMode.WORD_CHAR); layout.set_ellipsize (Pango.EllipsizeMode.END); layout.set_text (text, -1); + Pango.Context pango_context = layout.get_context (); + Gdk.Screen screen = Gdk.Screen.get_default (); + Pango.cairo_context_set_font_options (pango_context, + screen.get_font_options ()); + Pango.cairo_context_set_resolution (pango_context, + (float) settings.gtk_xft_dpi / + (float) Pango.SCALE); + layout.context_changed (); Pango.Rectangle log_rect; layout.get_extents (null, out log_rect); width = log_rect.width / Pango.SCALE; @@ -179,12 +188,21 @@ namespace Unity.QuicklistRendering cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f); Pango.Layout layout = Pango.cairo_create_layout (cr); + Gtk.Settings settings = Gtk.Settings.get_default (); Pango.FontDescription desc = Pango.FontDescription.from_string (font); desc.set_weight (Pango.Weight.NORMAL); layout.set_font_description (desc); layout.set_wrap (Pango.WrapMode.WORD_CHAR); layout.set_ellipsize (Pango.EllipsizeMode.END); layout.set_text (text, -1); + Pango.Context pango_context = layout.get_context (); + Gdk.Screen screen = Gdk.Screen.get_default (); + Pango.cairo_context_set_font_options (pango_context, + screen.get_font_options ()); + Pango.cairo_context_set_resolution (pango_context, + (float) settings.gtk_xft_dpi / + (float) Pango.SCALE); + layout.context_changed (); int text_width; int text_height; @@ -223,6 +241,7 @@ namespace Unity.QuicklistRendering // draw text Pango.Layout layout = Pango.cairo_create_layout (cr); + Gtk.Settings settings = Gtk.Settings.get_default (); Pango.FontDescription desc = Pango.FontDescription.from_string (font); desc.set_weight (Pango.Weight.NORMAL); layout.set_font_description (desc); @@ -230,6 +249,15 @@ namespace Unity.QuicklistRendering layout.set_ellipsize (Pango.EllipsizeMode.END); layout.set_text (text, -1); + Pango.Context pango_context = layout.get_context (); + Gdk.Screen screen = Gdk.Screen.get_default (); + Pango.cairo_context_set_font_options (pango_context, + screen.get_font_options ()); + Pango.cairo_context_set_resolution (pango_context, + (float) settings.gtk_xft_dpi / + (float) Pango.SCALE); + layout.context_changed (); + int text_width; int text_height; get_text_extents (font, text, out text_width, out text_height); |
