Commit 9dee9a84 authored by Matthias Clasen's avatar Matthias Clasen

Removed sealed members from GtkMenuItem

parent 05eb55dc
......@@ -394,10 +394,11 @@ gtk_private_h_sources = \
gtkfilesystem.h \
gtkfilesystemmodel.h \
gtkiconcache.h \
gtkimcontextsimpleseqs.h \
gtkimcontextsimpleseqs.h \
gtkintl.h \
gtkkeyhash.h \
gtkmenuprivate.h \
gtkmenuitemprivate.h \
gtkmenushellprivate.h \
gtkmnemonichash.h \
gtkmodifierstyle.h \
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,7 @@
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenuprivate.h"
#include "gtkmenuitemprivate.h"
#include "gtkmenushellprivate.h"
#include "gtktearoffmenuitem.h"
#include "gtkwindow.h"
......@@ -3032,13 +3033,13 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
* case the toggle size request depends on the size
* request of a child of the child (e.g. for ImageMenuItem)
*/
GTK_MENU_ITEM (child)->show_submenu_indicator = TRUE;
GTK_MENU_ITEM (child)->priv->show_submenu_indicator = TRUE;
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child), &toggle_size);
max_toggle_size = MAX (max_toggle_size, toggle_size);
max_accel_width = MAX (max_accel_width,
GTK_MENU_ITEM (child)->accelerator_width);
GTK_MENU_ITEM (child)->priv->accelerator_width);
part = child_min / (r - l);
min_width = MAX (min_width, part);
......@@ -3325,7 +3326,7 @@ get_accel_path (GtkWidget *menu_item,
path = _gtk_widget_get_accel_path (menu_item, locked);
if (!path)
{
path = GTK_MENU_ITEM (menu_item)->accel_path;
path = GTK_MENU_ITEM (menu_item)->priv->accel_path;
if (locked)
{
......@@ -3437,7 +3438,7 @@ gtk_menu_key_press (GtkWidget *widget,
if (can_change_accels &&
menu_shell->priv->active_menu_item &&
gtk_bin_get_child (GTK_BIN (menu_shell->priv->active_menu_item)) && /* no separators */
GTK_MENU_ITEM (menu_shell->priv->active_menu_item)->submenu == NULL && /* no submenus */
GTK_MENU_ITEM (menu_shell->priv->active_menu_item)->priv->submenu == NULL && /* no submenus */
(delete || gtk_accelerator_valid (accel_key, accel_mods)))
{
GtkWidget *menu_item = menu_shell->priv->active_menu_item;
......@@ -3505,7 +3506,7 @@ definitely_within_item (GtkWidget *widget,
gint x,
gint y)
{
GdkWindow *window = GTK_MENU_ITEM (widget)->event_window;
GdkWindow *window = GTK_MENU_ITEM (widget)->priv->event_window;
int w, h;
w = gdk_window_get_width (window);
......@@ -4250,10 +4251,10 @@ gtk_menu_leave_notify (GtkWidget *widget,
* with a submenu, in which case we enter submenu navigation mode.
*/
if (menu_shell->priv->active_menu_item != NULL
&& menu_item->submenu != NULL
&& menu_item->submenu_placement == GTK_LEFT_RIGHT)
&& menu_item->priv->submenu != NULL
&& menu_item->priv->submenu_placement == GTK_LEFT_RIGHT)
{
if (GTK_MENU_SHELL (menu_item->submenu)->priv->active)
if (GTK_MENU_SHELL (menu_item->priv->submenu)->priv->active)
{
gtk_menu_set_submenu_navigation_region (menu, menu_item, event);
return TRUE;
......@@ -4389,12 +4390,12 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
GtkMenuPopdownData *popdown_data;
GdkWindow *window;
g_return_if_fail (menu_item->submenu != NULL);
g_return_if_fail (menu_item->priv->submenu != NULL);
g_return_if_fail (event != NULL);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
window = gtk_widget_get_window (menu_item->submenu);
window = gtk_widget_get_window (menu_item->priv->submenu);
gdk_window_get_origin (window, &submenu_left, &submenu_top);
submenu_right = submenu_left + gdk_window_get_width (window);
......@@ -4413,7 +4414,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
* location of the rectangle. This is why the width or height
* can be negative.
*/
if (menu_item->submenu_direction == GTK_DIRECTION_RIGHT)
if (menu_item->priv->submenu_direction == GTK_DIRECTION_RIGHT)
{
/* right */
priv->navigation_x = submenu_left;
......@@ -5359,7 +5360,7 @@ gtk_menu_move_current (GtkMenuShell *menu_shell,
{
GtkWidget *parent = menu_shell->priv->parent_menu_shell;
if (! GTK_MENU_ITEM (menu_shell->priv->active_menu_item)->submenu &&
if (! GTK_MENU_ITEM (menu_shell->priv->active_menu_item)->priv->submenu &&
(!parent ||
g_list_length (GTK_MENU_SHELL (parent)->priv->children) <= 1))
match = menu_shell->priv->active_menu_item;
......
......@@ -32,7 +32,7 @@
#include "gtkbindings.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenuitem.h"
#include "gtkmenuitemprivate.h"
#include "gtkmenuprivate.h"
#include "gtkmenushellprivate.h"
#include "gtksettings.h"
......@@ -313,7 +313,7 @@ gtk_menu_bar_size_request (GtkWidget *widget,
{
gint toggle_size;
GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
GTK_MENU_ITEM (child)->priv->show_submenu_indicator = FALSE;
gtk_widget_get_preferred_size (child, &child_requisition, NULL);
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
&toggle_size);
......@@ -476,10 +476,11 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
child_requisition.width += toggle_size;
else
child_requisition.height += toggle_size;
/* Support for the right justified help menu */
if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
&& (GTK_MENU_ITEM(child)->right_justify))
if (children == NULL &&
GTK_IS_MENU_ITEM (child) &&
GTK_MENU_ITEM (child)->priv->right_justify)
{
ltr_x = allocation->width -
child_requisition.width - offset;
......@@ -526,11 +527,12 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
child_requisition.width += toggle_size;
else
child_requisition.height += toggle_size;
/* Support for the right justified help menu */
if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
&& (GTK_MENU_ITEM(child)->right_justify))
{
/* Support for the right justified help menu */
if (children == NULL &&
GTK_IS_MENU_ITEM (child) &&
GTK_MENU_ITEM (child)->priv->right_justify)
{
ltr_y = allocation->height -
child_requisition.height - offset;
}
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -36,57 +36,46 @@
G_BEGIN_DECLS
#define GTK_TYPE_MENU_ITEM (gtk_menu_item_get_type ())
#define GTK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItem))
#define GTK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
#define GTK_IS_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ITEM))
#define GTK_IS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM))
#define GTK_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
#define GTK_TYPE_MENU_ITEM (gtk_menu_item_get_type ())
#define GTK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItem))
#define GTK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
#define GTK_IS_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ITEM))
#define GTK_IS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM))
#define GTK_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
typedef struct _GtkMenuItem GtkMenuItem;
typedef struct _GtkMenuItemClass GtkMenuItemClass;
typedef struct _GtkMenuItem GtkMenuItem;
typedef struct _GtkMenuItemClass GtkMenuItemClass;
typedef struct _GtkMenuItemPrivate GtkMenuItemPrivate;
struct _GtkMenuItem
{
GtkBin bin;
GtkWidget *GSEAL (submenu);
GdkWindow *GSEAL (event_window);
guint16 GSEAL (toggle_size);
guint16 GSEAL (accelerator_width);
gchar *GSEAL (accel_path);
guint GSEAL (show_submenu_indicator) : 1;
guint GSEAL (submenu_placement) : 1;
guint GSEAL (submenu_direction) : 1;
guint GSEAL (right_justify): 1;
guint GSEAL (timer_from_keypress) : 1;
guint GSEAL (from_menubar) : 1;
guint GSEAL (timer);
/*< private >*/
GtkMenuItemPrivate *priv;
};
struct _GtkMenuItemClass
{
GtkBinClass parent_class;
/* If the following flag is true, then we should always hide
* the menu when the MenuItem is activated. Otherwise, the
/* If the following flag is true, then we should always
* hide the menu when the MenuItem is activated. Otherwise,
* it is up to the caller. For instance, when navigating
* a menu with the keyboard, <Space> doesn't hide, but
* <Return> does.
*/
guint hide_on_activate : 1;
void (* activate) (GtkMenuItem *menu_item);
void (* activate_item) (GtkMenuItem *menu_item);
void (* toggle_size_request) (GtkMenuItem *menu_item,
gint *requisition);
gint *requisition);
void (* toggle_size_allocate) (GtkMenuItem *menu_item,
gint allocation);
gint allocation);
void (* set_label) (GtkMenuItem *menu_item,
const gchar *label);
const gchar *label);
G_CONST_RETURN gchar *(* get_label) (GtkMenuItem *menu_item);
void (* select) (GtkMenuItem *menu_item);
......@@ -100,44 +89,36 @@ struct _GtkMenuItemClass
};
GType gtk_menu_item_get_type (void) G_GNUC_CONST;
GType gtk_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_menu_item_new (void);
GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
void gtk_menu_item_set_submenu (GtkMenuItem *menu_item,
GtkWidget *submenu);
GtkWidget *submenu);
GtkWidget* gtk_menu_item_get_submenu (GtkMenuItem *menu_item);
void gtk_menu_item_select (GtkMenuItem *menu_item);
void gtk_menu_item_deselect (GtkMenuItem *menu_item);
void gtk_menu_item_activate (GtkMenuItem *menu_item);
void gtk_menu_item_toggle_size_request (GtkMenuItem *menu_item,
gint *requisition);
gint *requisition);
void gtk_menu_item_toggle_size_allocate (GtkMenuItem *menu_item,
gint allocation);
gint allocation);
void gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
gboolean right_justified);
gboolean right_justified);
gboolean gtk_menu_item_get_right_justified (GtkMenuItem *menu_item);
void gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
const gchar *accel_path);
void gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
const gchar *accel_path);
G_CONST_RETURN gchar* gtk_menu_item_get_accel_path (GtkMenuItem *menu_item);
void gtk_menu_item_set_label (GtkMenuItem *menu_item,
const gchar *label);
const gchar *label);
G_CONST_RETURN gchar *gtk_menu_item_get_label (GtkMenuItem *menu_item);
void gtk_menu_item_set_use_underline (GtkMenuItem *menu_item,
gboolean setting);
gboolean setting);
gboolean gtk_menu_item_get_use_underline (GtkMenuItem *menu_item);
/* private */
void _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
const gchar *prefix,
GtkAccelGroup *accel_group,
gboolean group_changed);
gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
void _gtk_menu_item_popup_submenu (GtkWidget *menu_item,
gboolean with_delay);
void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
G_END_DECLS
......
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_MENU_ITEM_PRIVATE_H__
#define __GTK_MENU_ITEM_PRIVATE_H__
#include <gtk/gtkmenuitem.h>
#include <gtk/gtkaction.h>
G_BEGIN_DECLS
struct _GtkMenuItemPrivate
{
GtkWidget *submenu;
GdkWindow *event_window;
guint16 toggle_size;
guint16 accelerator_width;
gchar *accel_path;
guint show_submenu_indicator : 1;
guint submenu_placement : 1;
guint submenu_direction : 1;
guint right_justify : 1;
guint timer_from_keypress : 1;
guint from_menubar : 1;
guint use_action_appearance : 1;
guint timer;
GtkAction *action;
};
void _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
const gchar *prefix,
GtkAccelGroup *accel_group,
gboolean group_changed);
gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
void _gtk_menu_item_popup_submenu (GtkWidget *menu_item,
gboolean with_delay);
void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
G_END_DECLS
#endif /* __GTK_MENU_ITEM_PRIVATE_H__ */
......@@ -32,7 +32,7 @@
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenubar.h"
#include "gtkmenuitem.h"
#include "gtkmenuitemprivate.h"
#include "gtkmenushellprivate.h"
#include "gtkmenuprivate.h"
#include "gtkmnemonichash.h"
......@@ -645,9 +645,10 @@ gtk_menu_shell_button_press (GtkWidget *widget,
}
}
if (menu_item && _gtk_menu_item_is_selectable (menu_item) &&
GTK_MENU_ITEM (menu_item)->submenu != NULL &&
!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->submenu))
if (menu_item &&
_gtk_menu_item_is_selectable (menu_item) &&
GTK_MENU_ITEM (menu_item)->priv->submenu != NULL &&
!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->priv->submenu))
{
_gtk_menu_item_popup_submenu (menu_item, FALSE);
priv->activated_submenu = TRUE;
......@@ -701,7 +702,7 @@ gtk_menu_shell_button_release (GtkWidget *widget,
if (menu_item && (priv->active_menu_item == menu_item) &&
_gtk_menu_item_is_selectable (menu_item))
{
GtkWidget *submenu = GTK_MENU_ITEM (menu_item)->submenu;
GtkWidget *submenu = GTK_MENU_ITEM (menu_item)->priv->submenu;
if (submenu == NULL)
{
......@@ -955,11 +956,11 @@ gtk_menu_shell_enter_notify (GtkWidget *widget,
* its submenu.
*/
if ((event->state & (GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK)) &&
GTK_MENU_ITEM (menu_item)->submenu != NULL)
GTK_MENU_ITEM (menu_item)->priv->submenu != NULL)
{
GTK_MENU_SHELL (parent)->priv->activated_submenu = TRUE;
if (!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->submenu))
if (!gtk_widget_get_visible (GTK_MENU_ITEM (menu_item)->priv->submenu))
{
gboolean touchscreen_mode;
......@@ -1010,7 +1011,7 @@ gtk_menu_shell_leave_notify (GtkWidget *widget,
}
if ((priv->active_menu_item == event_widget) &&
(menu_item->submenu == NULL))
(menu_item->priv->submenu == NULL))
{
if ((event->detail != GDK_NOTIFY_INFERIOR) &&
(gtk_widget_get_state (GTK_WIDGET (menu_item)) != GTK_STATE_NORMAL))
......@@ -1225,7 +1226,7 @@ gtk_menu_shell_real_select_item (GtkMenuShell *menu_shell,
/* This allows the bizarre radio buttons-with-submenus-display-history
* behavior
*/
if (GTK_MENU_ITEM (priv->active_menu_item)->submenu)
if (GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu)
gtk_widget_activate (priv->active_menu_item);
}
......@@ -1447,11 +1448,11 @@ gtk_menu_shell_select_submenu_first (GtkMenuShell *menu_shell)
menu_item = GTK_MENU_ITEM (priv->active_menu_item);
if (menu_item->submenu)
if (menu_item->priv->submenu)
{
_gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item), FALSE);
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu_item->submenu), TRUE);
if (GTK_MENU_SHELL (menu_item->submenu)->priv->active_menu_item)
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu_item->priv->submenu), TRUE);
if (GTK_MENU_SHELL (menu_item->priv->submenu)->priv->active_menu_item)
return TRUE;
}
......@@ -1483,8 +1484,8 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
case GTK_MENU_DIR_PARENT:
if (touchscreen_mode &&
priv->active_menu_item &&
GTK_MENU_ITEM (priv->active_menu_item)->submenu &&
gtk_widget_get_visible (GTK_MENU_ITEM (priv->active_menu_item)->submenu))
GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu &&
gtk_widget_get_visible (GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu))
{
/* if we are on a menu item that has an open submenu but the
* focus is not in that submenu (e.g. because it's empty or
......@@ -1522,9 +1523,9 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
*/
else if (priv->active_menu_item &&
_gtk_menu_item_is_selectable (priv->active_menu_item) &&
GTK_MENU_ITEM (priv->active_menu_item)->submenu)
GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu)
{
GtkMenuShell *submenu = GTK_MENU_SHELL (GTK_MENU_ITEM (priv->active_menu_item)->submenu);
GtkMenuShell *submenu = GTK_MENU_SHELL (GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu);
if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement !=
GTK_MENU_SHELL_GET_CLASS (submenu)->submenu_placement)
......@@ -1535,7 +1536,7 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
case GTK_MENU_DIR_CHILD:
if (priv->active_menu_item &&
_gtk_menu_item_is_selectable (priv->active_menu_item) &&
GTK_MENU_ITEM (priv->active_menu_item)->submenu)
GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu)
{
if (gtk_menu_shell_select_submenu_first (menu_shell))
break;
......@@ -1562,17 +1563,13 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
case GTK_MENU_DIR_PREV:
gtk_menu_shell_move_selected (menu_shell, -1);
if (!had_selection &&
!priv->active_menu_item &&
priv->children)
if (!had_selection && !priv->active_menu_item && priv->children)
_gtk_menu_shell_select_last (menu_shell, TRUE);
break;
case GTK_MENU_DIR_NEXT:
gtk_menu_shell_move_selected (menu_shell, 1);
if (!had_selection &&
!priv->active_menu_item &&
priv->children)
if (!had_selection && !priv->active_menu_item && priv->children)
gtk_menu_shell_select_first (menu_shell, TRUE);
break;
}
......@@ -1587,7 +1584,7 @@ gtk_real_menu_shell_activate_current (GtkMenuShell *menu_shell,
if (priv->active_menu_item &&
_gtk_menu_item_is_selectable (priv->active_menu_item))
{
if (GTK_MENU_ITEM (priv->active_menu_item)->submenu == NULL)
if (GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu == NULL)
gtk_menu_shell_activate_item (menu_shell,
priv->active_menu_item,
force_hide);
......
......@@ -27,6 +27,7 @@
#include "config.h"
#include "gtkmenuprivate.h"
#include "gtkmenuitemprivate.h"
#include "gtktearoffmenuitem.h"
#include "gtkintl.h"
......@@ -186,28 +187,30 @@ gtk_tearoff_menu_item_draw (GtkWidget *widget,
else
shadow_type = GTK_SHADOW_OUT;
if (menu_item->toggle_size > ARROW_SIZE)
if (menu_item->priv->toggle_size > ARROW_SIZE)
{
if (direction == GTK_TEXT_DIR_LTR) {
arrow_x = x + (menu_item->toggle_size - ARROW_SIZE)/2;
arrow_x = x + (menu_item->priv->toggle_size - ARROW_SIZE)/2;
arrow_type = GTK_ARROW_LEFT;
}
else {
arrow_x = x + width - menu_item->toggle_size + (menu_item->toggle_size - ARROW_SIZE)/2;
arrow_type = GTK_ARROW_RIGHT;
arrow_x = x + width - menu_item->priv->toggle_size + (menu_item->priv->toggle_size - ARROW_SIZE)/2;
arrow_type = GTK_ARROW_RIGHT;
}
x += menu_item->toggle_size + BORDER_SPACING;
x += menu_item->priv->toggle_size + BORDER_SPACING;
}
else
{
if (direction == GTK_TEXT_DIR_LTR) {
arrow_x = ARROW_SIZE / 2;
arrow_type = GTK_ARROW_LEFT;
}
else {
arrow_x = x + width - 2 * ARROW_SIZE + ARROW_SIZE / 2;
arrow_type = GTK_ARROW_RIGHT;
}
if (direction == GTK_TEXT_DIR_LTR)
{
arrow_x = ARROW_SIZE / 2;
arrow_type = GTK_ARROW_LEFT;
}
else
{
arrow_x = x + width - 2 * ARROW_SIZE + ARROW_SIZE / 2;
arrow_type = GTK_ARROW_RIGHT;
}
x += 2 * ARROW_SIZE;
}
......@@ -216,7 +219,7 @@ gtk_tearoff_menu_item_draw (GtkWidget *widget,
state, shadow_type,
widget, "tearoffmenuitem",
arrow_type, FALSE,
arrow_x, y + height / 2 - 5,
arrow_x, y + height / 2 - 5,
ARROW_SIZE, ARROW_SIZE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment