]> Dogcows Code - chaz/openbox/blobdiff - openbox/menuframe.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / menuframe.c
index b48b9280dd8698fd3d1fe190eef2c67b016b161a..730f23f7c00307567e19dcf0650d6776d5236793 100644 (file)
@@ -254,23 +254,24 @@ static void menu_frame_place_topmenu(ObMenuFrame *self, gint *x, gint *y)
 
 static void menu_frame_place_submenu(ObMenuFrame *self, gint *x, gint *y)
 {
-    gint overlap;
+    gint overlapx, overlapy;
     gint bwidth;
 
-    overlap = ob_rr_theme->menu_overlap;
+    overlapx = ob_rr_theme->menu_overlap_x;
+    overlapy = ob_rr_theme->menu_overlap_y;
     bwidth = ob_rr_theme->mbwidth;
 
     if (self->direction_right)
         *x = self->parent->area.x + self->parent->area.width -
-            overlap - bwidth;
+            overlapx - bwidth;
     else
-        *x = self->parent->area.x - self->area.width + overlap + bwidth;
+        *x = self->parent->area.x - self->area.width + overlapx + bwidth;
 
     *y = self->parent->area.y + self->parent_entry->area.y;
     if (config_menu_middle)
         *y -= (self->area.height - (bwidth * 2) - ITEM_HEIGHT) / 2;
     else
-        *y += overlap;
+        *y += overlapy;
 }
 
 void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
@@ -338,6 +339,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
     default:
         g_assert_not_reached();
     }
+
     RECT_SET_SIZE(self->area, self->frame->inner_w, th);
     XResizeWindow(obt_display, self->window,
                   self->area.width, self->area.height);
@@ -386,8 +388,11 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
             text_a->texture[0].data.text.shortcut = FALSE;
         break;
     case OB_MENU_ENTRY_TYPE_SEPARATOR:
-        if (self->entry->data.separator.label != NULL)
+        if (self->entry->data.separator.label != NULL) {
             text_a = ob_rr_theme->a_menu_text_title;
+            text_a->texture[0].data.text.string =
+                self->entry->data.separator.label;
+        }
         else
             text_a = ob_rr_theme->a_menu_text_normal;
         break;
@@ -439,6 +444,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
                               self->area.width - 2*PADDING, SEPARATOR_HEIGHT);
 
             clear = ob_rr_theme->a_clear_tex;
+            RrAppearanceClearTextures(clear);
             clear->texture[0].type = RR_TEXTURE_LINE_ART;
             clear->surface.parent = item_a;
             clear->surface.parentx = PADDING;
@@ -456,7 +462,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
     }
 
     if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
-        self->entry->data.normal.icon_data)
+        self->entry->data.normal.icon)
     {
         RrAppearance *clear;
 
@@ -468,15 +474,12 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
                           - frame->item_margin.bottom);
 
         clear = ob_rr_theme->a_clear_tex;
-        clear->texture[0].type = RR_TEXTURE_RGBA;
-        clear->texture[0].data.rgba.width =
-            self->entry->data.normal.icon_width;
-        clear->texture[0].data.rgba.height =
-            self->entry->data.normal.icon_height;
-        clear->texture[0].data.rgba.alpha =
+        RrAppearanceClearTextures(clear);
+        clear->texture[0].type = RR_TEXTURE_IMAGE;
+        clear->texture[0].data.image.image =
+            self->entry->data.normal.icon;
+        clear->texture[0].data.image.alpha =
             self->entry->data.normal.icon_alpha;
-        clear->texture[0].data.rgba.data =
-            self->entry->data.normal.icon_data;
         clear->surface.parent = item_a;
         clear->surface.parentx = PADDING;
         clear->surface.parenty = frame->item_margin.top;
@@ -500,6 +503,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
                           - frame->item_margin.bottom);
 
         clear = ob_rr_theme->a_clear_tex;
+        RrAppearanceClearTextures(clear);
         clear->texture[0].type = RR_TEXTURE_MASK;
         clear->texture[0].data.mask.mask =
             self->entry->data.normal.mask;
@@ -691,7 +695,7 @@ void menu_frame_render(ObMenuFrame *self)
             tw = MIN(tw, MAX_MENU_WIDTH);
             th = ob_rr_theme->menu_font_height;
 
-            if (e->entry->data.normal.icon_data ||
+            if (e->entry->data.normal.icon ||
                 e->entry->data.normal.mask)
                 has_icon = TRUE;
             break;
@@ -702,7 +706,7 @@ void menu_frame_render(ObMenuFrame *self)
             tw = MIN(tw, MAX_MENU_WIDTH);
             th = ob_rr_theme->menu_font_height;
 
-            if (e->entry->data.normal.icon_data ||
+            if (e->entry->data.normal.icon ||
                 e->entry->data.normal.mask)
                 has_icon = TRUE;
 
This page took 0.025287 seconds and 4 git commands to generate.