mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 12:19:16 +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
|
begin
|
||||||
// create the menuitem widget (normal, check or radio)
|
// create the menuitem widget (normal, check or radio)
|
||||||
if AMenuItem.Caption = cLineCaption then // create separator
|
if AMenuItem.Caption = cLineCaption then // create separator
|
||||||
Widget := gtk_menu_item_new
|
Widget := gtk_separator_menu_item_new
|
||||||
else
|
else
|
||||||
if AMenuItem.RadioItem and not AMenuItem.HasIcon then
|
if AMenuItem.RadioItem and not AMenuItem.HasIcon then
|
||||||
Widget := gtk_radio_menu_item_new(nil)
|
Widget := gtk_radio_menu_item_new(nil)
|
||||||
@ -336,8 +336,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// set attributes (enabled and rightjustify)
|
// set attributes (enabled and rightjustify)
|
||||||
gtk_widget_set_sensitive(Widget,
|
gtk_widget_set_sensitive(Widget, AMenuItem.Enabled);
|
||||||
AMenuItem.Enabled and (AMenuItem.Caption <> cLineCaption));
|
|
||||||
if AMenuItem.RightJustify then
|
if AMenuItem.RightJustify then
|
||||||
gtk_menu_item_right_justify(PGtkMenuItem(Widget));
|
gtk_menu_item_right_justify(PGtkMenuItem(Widget));
|
||||||
|
|
||||||
@ -366,10 +365,14 @@ var
|
|||||||
begin
|
begin
|
||||||
if not WSCheckMenuItem(AMenuItem, 'SetCaption') then
|
if not WSCheckMenuItem(AMenuItem, 'SetCaption') then
|
||||||
Exit;
|
Exit;
|
||||||
|
if gtk_is_separator_menu_item(PGTKWidget(AMenuItem.Handle)) Or (ACaption = cLineCaption) then
|
||||||
|
AMenuItem.RecreateHandle
|
||||||
|
else
|
||||||
|
begin
|
||||||
MenuItemWidget:={%H-}PGtkWidget(AMenuItem.Handle);
|
MenuItemWidget:={%H-}PGtkWidget(AMenuItem.Handle);
|
||||||
UpdateInnerMenuItem(AMenuItem,MenuItemWidget);
|
UpdateInnerMenuItem(AMenuItem,MenuItemWidget);
|
||||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle),
|
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle), AMenuItem.Enabled);
|
||||||
AMenuItem.Enabled and (ACaption <> cLineCaption));
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGtk2WSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
class procedure TGtk2WSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||||
@ -449,8 +452,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
|
if not WSCheckMenuItem(AMenuItem, 'SetEnable') then
|
||||||
Exit;
|
Exit;
|
||||||
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle),
|
gtk_widget_set_sensitive({%H-}PGtkWidget(AMenuItem.Handle), Enabled);
|
||||||
Enabled and (AMenuItem.Caption <> cLineCaption));
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user