Commit 0ac5d3d4 authored by gambas's avatar gambas
Browse files

Label: Use floating point text size to avoid possible text truncation.

[GB.GUI.BASE]
* NEW: Label: Use floating point text size to avoid possible text truncation.
parent 4616f823
Pipeline #442183987 passed with stage
in 20 minutes and 34 seconds
......@@ -8,7 +8,7 @@ Component=gb.image
Component=gb.gui
Component=gb.settings
Arguments=[["-style=oxygen"],["-style=qtcurve"]]
Environment="GB_JIT_DEBUG=1\nGB_GUI=gb.qt5\nLIBOVERLAY_SCROLLBAR=0\n GTK_DEBUG=interactive"
Environment="GB_JIT_DEBUG=1\nGB_GUI=gb.gtk3\nLIBOVERLAY_SCROLLBAR=0\n GTK_DEBUG=interactive"
TabSize=2
Translate=1
Language=en
......
......@@ -143,6 +143,8 @@ Public Sub _UpdateSize()
W = hRect.W + P * 2
H = hRect.H + P * 2
'Debug Me.Name; ": "; Me.Font.ToString();; W
If Align.IsMiddle($iAlign) Then
If H < Me.H Then H = Me.H
Endif
......@@ -172,6 +174,8 @@ Private Sub GetExtents() As RectF
Dim X As Float
' Check Paint.Scalable to workaround a QT bug with Paint.TextExtents() on such fonts
If Not $hExt Then
If $bRichText Then
If _Wrap Then
......@@ -185,7 +189,8 @@ Private Sub GetExtents() As RectF
If Paint.Font.Scalable Then X = Paint.TextExtents(LTrim($sText)).X
Endif
$hExt.X = CInt(X)
'Debug Me.Name; ": "; Paint.Font.ToString();; $hExt.W;; "[";; X;; "]"
$hExt.X = X
Endif
Return $hExt
......@@ -197,8 +202,8 @@ Public Sub UserControl_Draw()
Dim P As Integer
Dim F As Integer
Dim hExt As RectF
Dim W As Integer
Dim X As Integer
Dim W As Float
Dim X As Float
If $iBorder Then
Style.PaintPanel(0, 0, Paint.W, Paint.H, $iBorder)
......@@ -226,7 +231,7 @@ Public Sub UserControl_Draw()
Endif
W = Me.W - X - P - hExt.X
'
If Not Me.Enabled Then Paint.Background = Color.Merge(Style.BackgroundOf(Me), Style.ForegroundOf(Me))
If $bRichText Then
......
......@@ -364,8 +364,6 @@ Public Sub _ReparentItem(hItem As _TreeView_Item, Parent As String)
End
Private Sub GetNextItem(hItem As _Treeview_Item) As _TreeView_Item
Dim hParent As _TreeView_Item
......
Supports Markdown
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