TabPanel: The tab close button will not appear incorrectly anymore.

[GB.FORM]
* BUG: TabPanel: The tab close button will not appear incorrectly anymore.
This commit is contained in:
gambas 2018-03-03 03:15:16 +01:00
parent 58ddc650ad
commit 51dd51dff7
2 changed files with 12 additions and 4 deletions

View file

@ -8,7 +8,7 @@ Component=gb.image
Component=gb.gui
Component=gb.settings
Authors="Benoît Minisini"
Environment="GB_GUI=gb.gtk"
Environment="GB_GUI=gb.qt5"
TabSize=2
Translate=1
Language=en

View file

@ -30,6 +30,7 @@ Private $DX As Integer
Private $SX As Integer
Private $hTimerDrag As Timer
Private $bClosable As Boolean
Private $bInside As Boolean
Public Sub _new()
@ -132,7 +133,7 @@ Public Sub DrawingArea_Draw()
If Not hFont Then hFont = hTabPanel.Font
Paint.Font = hFont
If Not $bSelected And If $hDrawingArea.Hovered Then
If Not $bSelected And If $bInside Then
If $bRichText Then
Paint.DrawRichTextShadow($sText, X, 0, W, Me.Height, Align.Center)
Else
@ -344,6 +345,7 @@ End
Public Sub DrawingArea_Enter()
'Debug ">";; Me.Text
$bInside = True
$hDrawingArea.Tracking = True
$bShowClose = IsClosable()
$hDrawingArea.Refresh
@ -360,6 +362,7 @@ End
Public Sub DrawingArea_Leave()
'Debug "<";; Me.Text
$bInside = False
$bShowClose = False
$bInClose = False
SetMouse
@ -374,14 +377,16 @@ Public Sub DrawingArea_MouseMove()
Dim X As Integer
Dim bShowClose As Boolean
Dim bShift As Boolean
Dim Y As Integer
If $bDrag Then TimerDrag_Timer
X = Mouse.ScreenX - Me.ScreenX
Y = Mouse.ScreenY - Me.ScreenY
Try bShift = Mouse.Shift And Mouse.Control
If Not Error And If bShift Then Debug X
'If Not Error And If bShift Then Debug X
If X >= 0 And If X < Me.W Then
If X >= 0 And If X < Me.W And If Y >= 0 And If Y < Me.H Then
bShowClose = IsClosable()
If bShowClose Then
@ -391,6 +396,9 @@ Public Sub DrawingArea_MouseMove()
bInClose = (X >= (Me.W - BUTTON_SIZE)) And (X < Me.W)
Endif
Endif
$bInside = True
Else
$bInside = False
Endif
If bInClose <> $bInClose Or If bShowClose <> $bShowClose Then