mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 20:39:15 +02:00
Merged revision(s) 48843 #de22645de5 from trunk:
Gtk2: fixed menu item separator. issue #27905 ........ git-svn-id: branches/fixes_1_4@48862 -
This commit is contained in:
parent
9cf3760120
commit
64bec6f450
@ -308,7 +308,7 @@ var
|
||||
begin
|
||||
// create the menuitem widget (normal, check or radio)
|
||||
if AMenuItem.Caption = cLineCaption then // create separator
|
||||
Widget := gtk_menu_item_new
|
||||
Widget := gtk_separator_menu_item_new
|
||||
else
|
||||
if AMenuItem.RadioItem and not AMenuItem.HasIcon then
|
||||
Widget := gtk_radio_menu_item_new(nil)
|
||||
@ -336,8 +336,7 @@ begin
|
||||
end;
|
||||
|
||||
// set attributes (enabled and rightjustify)
|
||||
gtk_widget_set_sensitive(Widget,
|
||||
AMenuItem.Enabled and (AMenuItem.Caption <> cLineCaption));
|
||||
gtk_widget_set_sensitive(Widget, AMenuItem.Enabled);
|
||||
if AMenuItem.RightJustify then
|
||||
gtk_menu_item_right_justify(PGtkMenuItem(Widget));
|
||||
|
||||
@ -366,10 +365,14 @@ var
|
||||
begin
|
||||
if not WSCheckMenuItem(AMenuItem, 'SetCaption') then
|
||||
Exit;
|
||||
if gtk_is_separator_menu_item(PGTKWidget(AMenuItem.Handle)) Or (ACaption = cLineCaption) then
|
||||
AMenuItem.RecreateHandle
|
||||
else
|
||||
begin
|
||||
MenuItemWidget:={%H-}PGtkWidget(AMenuItem.Handle);
|
||||
UpdateInnerMenuItem(AMenuItem,MenuItemWidget);
|
||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle),
|
||||
AMenuItem.Enabled and (ACaption <> cLineCaption));
|
||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle), AMenuItem.Enabled);
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
@ -449,8 +452,7 @@ begin
|
||||
Result := False;
|
||||
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
|
||||
Exit;
|
||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle),
|
||||
Enabled and (AMenuItem.Caption <> cLineCaption));
|
||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle), Enabled);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user