From ff2d1f6e5bdac645fa0a632d6c0de4664e32229d Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 25 Feb 2022 03:10:44 +0100 Subject: [PATCH] Some fixes in the welcome dialog. [DEVELOPMENT ENVIRONMENT] * NEW: Welcome dialog: Allow it to be smaller. * BUG: Welcome dialog: Correctly draw project boxes in small mode. * NEW: Version control: Make branch colors darker. --- app/src/gambas3/.src/FMain.class | 8 +++++--- app/src/gambas3/.src/Project/ProjectBox.class | 13 +++++++------ .../.src/VersionControl/VersionControl.module | 2 +- app/src/gambas3/.src/Welcome/FWelcome.class | 8 +++++++- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/src/gambas3/.src/FMain.class b/app/src/gambas3/.src/FMain.class index 093c82f71..f72d2289b 100644 --- a/app/src/gambas3/.src/FMain.class +++ b/app/src/gambas3/.src/FMain.class @@ -2634,11 +2634,13 @@ End Public Sub Form_Resize() Dim W, H As Integer + Dim DS As Integer If dwgWelcome.Visible Then - W = Desktop.Scale * 106 + 64 - If W > Me.ClientW Then W = Max(Me.ClientW, Desktop.Scale * 80 + 64) - H = Max(Desktop.Scale * 90 + 64, Me.ClientH - 64) + DS = Desktop.Scale + W = DS * 113 + 1 + If W > Me.ClientW Then W = Max(Me.ClientW, DS * 70) + H = Max(DS * 60, Me.ClientH) dwgWelcome.Move((Me.ClientW - W) \ 2, (Me.ClientH - H) \ 2, W, H) Endif diff --git a/app/src/gambas3/.src/Project/ProjectBox.class b/app/src/gambas3/.src/Project/ProjectBox.class index 2f086d250..8f0af27e4 100644 --- a/app/src/gambas3/.src/Project/ProjectBox.class +++ b/app/src/gambas3/.src/Project/ProjectBox.class @@ -264,12 +264,13 @@ Public Sub DrawingArea_Draw() hExt = Paint.TextExtents(sText) HT = Paint.Font.Height Paint.DrawText(sText, X + WT, Y, Paint.W, Paint.H, Align.TopLeft) + WT += Paint.Font.TextWidth(sText) If .Branch Then - XB = X + hExt.Width + P - YB = Y - 2 - HB = Ceil(hExt.H) + 4 + XB = X + WT + P + YB = Y + HB = HT GoSub DRAW_BRANCH @@ -292,13 +293,13 @@ Public Sub DrawingArea_Draw() sText = .Version hExt = Paint.TextExtents(sText) HT = Paint.Font.H - Paint.DrawText(sText, X, Y + HT, Paint.W, hExt.H, Align.Left) + Paint.DrawText(sText, X, Y + HT, Paint.W, HT, Align.Left) If .Branch Then XB = X + hExt.Width + P - YB = Y + HT - 2 - HB = Ceil(hExt.H) + 4 + YB = Y + HT + HB = HT 'Ceil(hExt.H) + 4 GoSub DRAW_BRANCH diff --git a/app/src/gambas3/.src/VersionControl/VersionControl.module b/app/src/gambas3/.src/VersionControl/VersionControl.module index c12cf81ae..3fafb1038 100644 --- a/app/src/gambas3/.src/VersionControl/VersionControl.module +++ b/app/src/gambas3/.src/VersionControl/VersionControl.module @@ -34,7 +34,7 @@ Private $bCancel As Boolean Private $sCurrentBranch As String Private $cBranchColor As New Collection -Private $aBranchColor As Integer[] = [&HFF0000, &HFF007F, &HFF00FF, &H7F00FF, &H0000FF, &H007FFF, &H00E0E0, &H00E000, &HE0E000, &HFFBF00, &HFF7F00, &HC00000, &HC00060, &HC000C0, &H00A0A0, &H00A000, &HA0A000, &HC09000, &HC05C00] +Private $aBranchColor As Integer[] = [&HE00000, &HE00070, &HE000E0, &H6C00E0, &H0000E0, &H0060C0, &H00C0C0, &H00C000, &HC0C000, &HE0A400, &HC05C00, &HA00000, &HA00050, &HA000A0, &H008080, &H008000, &H808000, &HA07800, &HA04A00] Private Const DEFAULT_BRANCH_COLOR As Integer = &H606060 diff --git a/app/src/gambas3/.src/Welcome/FWelcome.class b/app/src/gambas3/.src/Welcome/FWelcome.class index 06cbe6915..c961892db 100644 --- a/app/src/gambas3/.src/Welcome/FWelcome.class +++ b/app/src/gambas3/.src/Welcome/FWelcome.class @@ -434,7 +434,7 @@ Public Sub panList_Arrange() Dim iArr As Integer - iArr = If(panList.W > Desktop.Scale * 70, Arrange.Row, Arrange.Vertical) + iArr = If(panList.W >= Desktop.Scale * 70, Arrange.Row, Arrange.Vertical) 'Debug iArr;; panList.W;; Desktop.Scale * 64 $hRecent.SetArrangement(iArr) $hExample.SetArrangement(iArr) @@ -460,3 +460,9 @@ Public Sub MediaPlayer_End() End + +Public Sub Form_Arrange() + + + +End