From dd664de989fca5d4cc532dffa3e3d0eea3b8248b Mon Sep 17 00:00:00 2001 From: gambas Date: Sun, 22 Nov 2020 19:43:44 +0100 Subject: [PATCH] MenuButton: Fix its behaviour for GTK+3. [GB.FORM] * BUG: MenuButton: Fix draing for GTK+3. * BUG: MenuButton: Fix hidden shortcut button for GTK+3. --- comp/src/gb.form/.src/Button/MenuButton.class | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/comp/src/gb.form/.src/Button/MenuButton.class b/comp/src/gb.form/.src/Button/MenuButton.class index 738d063d9..009181481 100644 --- a/comp/src/gb.form/.src/Button/MenuButton.class +++ b/comp/src/gb.form/.src/Button/MenuButton.class @@ -99,7 +99,8 @@ Private Sub Text_Write(Value As String) $hButton.Ignore = True $hButton.Border = False S = Desktop.Scale * 3 - $hButton.Move(0, -S, S, S) + $hButton.Move(0, 0, S, S) + $hButton.Lower() Endif $hButton.Text = String.Mid$($sText, iPos, 2) $iShortcutPos = iPos @@ -430,10 +431,13 @@ Public Sub DrawingArea_Draw() If bMenu Then Paint.FillRect(1, 1, Me.W - 2, Me.H - 2, Color.SelectedBackground) - Else If $bInsideArrow Or If $bMenuOnly Then - Style.PaintButton(0, 0, Me.W, Me.H, False, iFlag, bFlat) - Else - Style.PaintButton(0, 0, Me.W, Me.H, $bPressed, iFlag, bFlat) + Else + Paint.FillRect(1, 1, Me.W - 2, Me.H - 2, Color.Background) + If $bInsideArrow Or If $bMenuOnly Then + Style.PaintButton(0, 0, Me.W, Me.H, False, iFlag, bFlat) + Else + Style.PaintButton(0, 0, Me.W, Me.H, $bPressed, iFlag, bFlat) + Endif Endif If $hPicture Then