From 9162d1c71e5e1e5e8c3d72846c7b0d2aa5cadccf Mon Sep 17 00:00:00 2001 From: mk-soft-65 <66120133+mk-soft-65@users.noreply.github.com> Date: Sun, 30 Nov 2025 13:43:35 +0100 Subject: [PATCH] FormDesigner Update - Linux, macOS code correction Toolbar position - FormDesigner Toolspanel Coloring (Darkmode) - Update Color Schema Dark Mode --- PureBasicIDE/FormDesigner/FormManagement.pb | 7 +- PureBasicIDE/FormDesigner/codeviewer.pb | 21 ++++-- PureBasicIDE/FormDesigner/declare.pb | 64 ++++++++++++++----- PureBasicIDE/FormDesigner/mainevents.pb | 33 +++------- PureBasicIDE/FormDesigner/mainwindow.pb | 3 + PureBasicIDE/FormDesigner/opensave.pb | 6 ++ PureBasicIDE/MacExtensions.pb | 13 ++++ .../data/DefaultColorSchemes/Dark Mode.prefs | 22 +++---- 8 files changed, 105 insertions(+), 64 deletions(-) diff --git a/PureBasicIDE/FormDesigner/FormManagement.pb b/PureBasicIDE/FormDesigner/FormManagement.pb index cae63ec7..c8194fcd 100644 --- a/PureBasicIDE/FormDesigner/FormManagement.pb +++ b/PureBasicIDE/FormDesigner/FormManagement.pb @@ -270,18 +270,13 @@ Procedure FormPanel_CreateFunction(*Entry.ToolsPanelEntry) grid_SetGadgetAttribute(propgrid, #Grid_Caption_Col, 1) grid_SetGadgetAttribute(propgrid, #Grid_Disable_Delete, 1) - CompilerIf #CompileMac - grid_SetGadgetColor(propgrid, #Grid_Color_LineLight, GetCocoaColor("systemGrayColor")) - CompilerElse - grid_SetGadgetColor(propgrid, #Grid_Color_LineLight, RGB(238, 238, 238)) - CompilerEndIf - propgrid_combo = grid_CreateComboBox(propgrid) propgrid_proccombo = grid_CreateComboBox(propgrid) grid_SetColumnWidth(propgrid, 0, 20) grid_SetColumnWidth(propgrid, 1) grid_SetColumnWidth(propgrid, 2, grid_GadgetWidth(propgrid) - grid_GetColumnWidth(propgrid, 0) - grid_GetColumnWidth(propgrid, 1)) + CloseGadgetList() ; Close the container SplitterGadget(#Form_SplitterInt, 0, 0, 100, 200, #Form_Prop, #Form_GridContainer, #PB_Splitter_FirstFixed) diff --git a/PureBasicIDE/FormDesigner/codeviewer.pb b/PureBasicIDE/FormDesigner/codeviewer.pb index 9c3001b0..c4408100 100644 --- a/PureBasicIDE/FormDesigner/codeviewer.pb +++ b/PureBasicIDE/FormDesigner/codeviewer.pb @@ -405,11 +405,13 @@ Procedure.s FD_SelectCode(contentonly = 0, testcode = 0) codepaddingheight + " - MenuHeight()" EndIf If ListSize(FormWindows()\FormToolbars()) - If codepaddingy <> "" - codepaddingy + " + " + If FormSkin = #PB_OS_Windows + If codepaddingy <> "" + codepaddingy + " + " + EndIf + codepaddingy + "ToolBarHeight("+Str(toolbarcount - 1)+")" + codepaddingheight + " - ToolBarHeight("+Str(toolbarcount - 1)+")" EndIf - codepaddingy + "ToolBarHeight("+Str(toolbarcount - 1)+")" - codepaddingheight + " - ToolBarHeight("+Str(toolbarcount - 1)+")" EndIf If ListSize(FormWindows()\FormStatusbars()) codepaddingheight + " - StatusBarHeight("+Str(statusbarcount - 1)+")" @@ -695,11 +697,16 @@ Procedure.s FD_SelectCode(contentonly = 0, testcode = 0) linevars + Str(tempvalue - (FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1)) Else + ;- Change height menu and toolbar calc value = FormWindows()\height - (FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1) - - If FormSkin <> #PB_OS_MacOS + If FormSkin = #PB_OS_Windows + value - bottompaddingsb - toptoolpadding - + If ListSize(FormWindows()\FormMenus()) + value - P_Menu + EndIf + ElseIf FormSkin = #PB_OS_Linux + value - bottompaddingsb If ListSize(FormWindows()\FormMenus()) value - P_Menu EndIf diff --git a/PureBasicIDE/FormDesigner/declare.pb b/PureBasicIDE/FormDesigner/declare.pb index 89232c9a..12e85a28 100644 --- a/PureBasicIDE/FormDesigner/declare.pb +++ b/PureBasicIDE/FormDesigner/declare.pb @@ -6,16 +6,21 @@ UseJPEGImageDecoder() UsePNGImageDecoder() -Global P_WinHeight, P_Status, P_Menu, P_Font.s, P_FontSize, P_FontSizeL +Global P_WinHeight, P_Status, P_Menu, P_Toolbar, P_Font.s, P_FontSize, P_FontSizeL Global P_FontGadget.s, P_FontGadgetSize, P_FontMenu.s, P_FontMenuSize, P_FontColumn.s, P_FontColumnSize, P_FontGrid.s Global P_SplitterWidth, ScrollAreaW, Panel_Height, P_ScrollWidth Global multiselectStart, multiselectParent, multiselectFirstScan +Global grid_color_bg.l, grid_color_fg.l, grid_color_text.l, grid_color_light.l, grid_color_mid.l, grid_color_dark.l + #Page_Padding = 10 CompilerSelect #PB_Compiler_OS CompilerCase #PB_OS_MacOS + + Declare GetCocoaColor(NSColorName.s) + P_FontGrid = "Lucida Grande" #P_FontGridSize = 13 #P_FontCode = "Monaco" @@ -31,8 +36,8 @@ CompilerSelect #PB_Compiler_OS #P_FontCode = "Courier New" #P_FontCodeSize = 11 CompilerCase #PB_OS_Linux - P_FontGrid = "Lucida Grande" - #P_FontGridSize = 11 + P_FontGrid = "DejaVu Sans" + #P_FontGridSize = 10 #P_FontCode = "Monaco" #P_FontCodeSize = 11 CompilerEndSelect @@ -1211,6 +1216,7 @@ Procedure InitVars() P_WinHeight = 22 P_Status = 24 P_Menu = 23 + P_Toolbar = 36 P_Font.s = "Lucida Grande" P_FontSize = 9 P_FontSizeL = 10 @@ -1244,6 +1250,7 @@ Procedure InitVars() P_WinHeight = 29 P_Status = 23 P_Menu = 22 + P_Toolbar = 24 P_FontSize = 9 P_FontSizeL = 10 P_FontGadgetSize = 9 @@ -1256,17 +1263,18 @@ Procedure InitVars() Panel_Height = 22 Case #PB_OS_Linux P_WinHeight = 28 - P_Status = 23 - P_Menu = 22 - P_Font.s = "Lucida Grande" - P_FontSize = 10 + P_Status = 26 + P_Menu = 28 + P_Toolbar = 38 + P_Font.s = "DejaVu Sans" + P_FontSize = 9 P_FontSizeL = 11 - P_FontGadget.s = "Lucida Grande" - P_FontGadgetSize = 11 - P_FontMenu.s = "Lucida Grande" - P_FontMenuSize = 12 - P_FontColumn.s = "Lucida Grande" - P_FontColumnSize = 9 + P_FontGadget.s = "DejaVu Sans" + P_FontGadgetSize = 9 + P_FontMenu.s = "DejaVu Sans" + P_FontMenuSize = 11 + P_FontColumn.s = "DejaVu Sans" + P_FontColumnSize = 11 P_SplitterWidth = 9 P_ScrollWidth = 18 @@ -1281,8 +1289,34 @@ Procedure InitVars() P_FontMenuSize + 3 P_FontColumnSize + 3 CompilerEndIf - - + + CompilerIf #CompileMac + If DisplayDarkMode + grid_color_bg = GetCocoaColor("underPageBackgroundColor") + grid_color_text = GetCocoaColor("textColor") + grid_color_light = GetCocoaColor("windowBackgroundColor") + grid_color_mid = #Gray + Else + grid_color_bg = RGB(238, 238, 238) + grid_color_text = #Black + grid_color_light = #Gray; RGB(238, 238, 238) + grid_color_mid = #Gray + EndIf + CompilerElse + CompilerIf #CompileLinuxGtk + Global *Style.GtkStyle = gtk_widget_get_style_(WindowID(#WINDOW_Main)) + grid_color_bg = RGB(*Style\bg[#GTK_STATE_NORMAL]\red >> 8, *Style\bg[#GTK_STATE_NORMAL]\green >> 8, *Style\bg[#GTK_STATE_NORMAL]\blue >> 8) + grid_color_text = RGB(*Style\text[#GTK_STATE_NORMAL]\red >> 8, *Style\text[#GTK_STATE_NORMAL]\green >> 8, *Style\text[#GTK_STATE_NORMAL]\blue >> 8) + grid_color_light = RGB(*Style\light[#GTK_STATE_NORMAL]\red >> 8, *Style\light[#GTK_STATE_NORMAL]\green >> 8, *Style\light[#GTK_STATE_NORMAL]\blue >> 8) + grid_color_mid = RGB(*Style\mid[#GTK_STATE_NORMAL]\red >> 8, *Style\mid[#GTK_STATE_NORMAL]\green >> 8, *Style\mid[#GTK_STATE_NORMAL]\blue >> 8) + CompilerElse + grid_color_bg = RGB(238, 238, 238) + grid_color_text = #Black + grid_color_light = #Gray; RGB(238, 238, 238) + grid_color_mid = #Gray + CompilerEndIf + CompilerEndIf + If IsFont(#Form_Font) : FreeFont(#Form_Font) : EndIf If IsFont(#Form_FontColumnHeader) : FreeFont(#Form_FontColumnHeader) : EndIf If IsFont(#Form_FontMenu) : FreeFont(#Form_FontMenu) : EndIf diff --git a/PureBasicIDE/FormDesigner/mainevents.pb b/PureBasicIDE/FormDesigner/mainevents.pb index e0e7619a..88eb9205 100644 --- a/PureBasicIDE/FormDesigner/mainevents.pb +++ b/PureBasicIDE/FormDesigner/mainevents.pb @@ -203,18 +203,11 @@ Procedure PropGridAddNode(grid, row, title.s) grid_SetCellType(grid, 0, row, #Grid_Cell_Custom) grid_SetCellState(grid, 0, row, @PropGridFoldImgProc()) - CompilerIf #CompileMac - grid_SetCellBackColor(grid, 0, row, GetCocoaColor("controlBackgroundColor")) - grid_SetCellBackColor(grid, 1, row, GetCocoaColor("controlBackgroundColor")) - grid_SetCellBackColor(grid, 2, row, GetCocoaColor("controlBackgroundColor")) - CompilerElse - grid_SetCellBackColor(grid, 0, row, RGB(238, 238, 238)) - grid_SetCellBackColor(grid, 1, row, RGB(238, 238, 238)) - grid_SetCellBackColor(grid, 2, row, RGB(238, 238, 238)) - CompilerEndIf - + grid_SetCellBackColor(grid, 0, row, grid_color_bg) + grid_SetCellBackColor(grid, 1, row, grid_color_bg) + grid_SetCellBackColor(grid, 2, row, grid_color_bg) grid_SetCellString(grid, 1, row, title) - grid_SetSelectionStyle(grid, 1, row, "", -1, 1, -1, -1, -1, -1, 0, Len(title)) + grid_SetSelectionStyle(grid, 1, row, "", -1, 1, -1, -1, -1, grid_color_text, 0, Len(title)) grid_SetCellLockState(grid, 0, row, 1) grid_SetCellLockState(grid, 1, row, 1) @@ -223,11 +216,7 @@ Procedure PropGridAddNode(grid, row, title.s) EndProcedure Procedure PropGridAddItem(grid, row, title.s, value.s = "") grid_InsertRow(grid, row) - CompilerIf #CompileMac - grid_SetCellBackColor(grid, 0, row, GetCocoaColor("controlBackgroundColor")) - CompilerElse - grid_SetCellBackColor(grid, 0, row, RGB(238, 238, 238)) - CompilerEndIf + grid_SetCellBackColor(grid, 0, row, grid_color_bg) grid_SetCellString(grid, 1, row, title) grid_SetCellString(grid, 2, row, value) grid_SetCellLockState(grid,0,row,1) @@ -365,7 +354,7 @@ Procedure FD_UpdateScrollbars(resizewin = 0) EndIf Else OpenGadgetList(#GADGET_Form) - ScrollBarGadget(#GADGET_Form_ScrollV,GadgetWidth(#GADGET_Form)-Grid_Scrollbar_Width,0,Grid_Scrollbar_Width,sheight,0,400,GadgetHeight(#GADGET_Form_Canvas),#PB_ScrollBar_Vertical) + ScrollBarGadget(#GADGET_Form_ScrollV,GadgetWidth(#GADGET_Form)-Grid_Scrollbar_Width,0,Grid_Scrollbar_Width,sheight,0,800,GadgetHeight(#GADGET_Form_Canvas),#PB_ScrollBar_Vertical) BindGadgetEvent(#GADGET_Form_ScrollV, @Form_Scrollbars()) CloseGadgetList() EndIf @@ -3789,7 +3778,7 @@ Procedure FD_Move(x,y) If y2 = 0 y2 = FormWindows()\height - bottompaddingsb - If FormSkin <> #PB_OS_MacOS + If FormSkin = #PB_OS_MacOS y2 - toptoolpadding - topmenupadding EndIf EndIf @@ -5031,13 +5020,7 @@ Procedure FD_Redraw() EndIf If ListSize(FormWindows()\FormToolbars()) Or FormWindows()\toolbar_visible - toptoolpadding = 16 - - If FormSkin = #PB_OS_MacOS - toptoolpadding + 8 ; top3, bottom5 - Else - toptoolpadding + 6 - EndIf + toptoolpadding = P_Toolbar Else toptoolpadding = 0 EndIf diff --git a/PureBasicIDE/FormDesigner/mainwindow.pb b/PureBasicIDE/FormDesigner/mainwindow.pb index be43d0c1..f6c3a4c6 100644 --- a/PureBasicIDE/FormDesigner/mainwindow.pb +++ b/PureBasicIDE/FormDesigner/mainwindow.pb @@ -6,6 +6,9 @@ Procedure FD_InitBasicPropGridRows(gadget = 0) + + grid_SetGadgetColor(propgrid, #Grid_Color_LineLight, grid_color_light) + PropGridAddNode(propgrid, i, "Properties") i + 1 diff --git a/PureBasicIDE/FormDesigner/opensave.pb b/PureBasicIDE/FormDesigner/opensave.pb index aa5d93a4..f76dc967 100644 --- a/PureBasicIDE/FormDesigner/opensave.pb +++ b/PureBasicIDE/FormDesigner/opensave.pb @@ -350,6 +350,9 @@ Procedure OpenReadGadgetParams(line.s) ; remove toolbarheight/menuheight tempvalue = ReplaceString(tempvalue,"MenuHeight()","") tempvalue = ReplaceString(tempvalue,"+","") + ;- Change + tempvalue = ReplaceString(tempvalue,"FormWindowTop","") + tempvalue = ReplaceString(tempvalue,"+","") toolpos = FindString(tempvalue,"ToolBarHeight(") If toolpos toolend = FindString(tempvalue,")",toolpos) + 1 @@ -413,6 +416,9 @@ Procedure OpenReadGadgetParams(line.s) ;{ y2 tempvalue.s = Trim(Mid(line,start,startnext-start)) toolpos = FindString(tempvalue,"ToolBarHeight(") + ;- Change + tempvalue = ReplaceString(tempvalue,"FormWindowTop","") + tempvalue = ReplaceString(tempvalue,"+","") If toolpos toolend = FindString(tempvalue,")",toolpos) + 1 tempvalue = Left(tempvalue,toolpos - 1) + Right(tempvalue,Len(tempvalue) - toolend) diff --git a/PureBasicIDE/MacExtensions.pb b/PureBasicIDE/MacExtensions.pb index d15cc466..df1b4e77 100644 --- a/PureBasicIDE/MacExtensions.pb +++ b/PureBasicIDE/MacExtensions.pb @@ -277,6 +277,13 @@ CompilerIf #CompileMacCocoa EndIf Next EndWith + If DisplayDarkMode + ; Update FormDesigner GridGadget + grid_color_bg = GetCocoaColor("underPageBackgroundColor") + grid_color_text = GetCocoaColor("textColor") + grid_color_light = GetCocoaColor("windowBackgroundColor") + grid_color_mid = #Gray + EndIf EndIf EndProcedure @@ -311,7 +318,13 @@ CompilerIf #CompileMacCocoa EndIf Next EndWith + ; Update FormDesigner GridGadget + grid_color_bg = GetCocoaColor("underPageBackgroundColor") + grid_color_text = GetCocoaColor("textColor") + grid_color_light = GetCocoaColor("windowBackgroundColor") + grid_color_mid = #Gray EndIf + EndSelect EndProcedure diff --git a/PureBasicIDE/data/DefaultColorSchemes/Dark Mode.prefs b/PureBasicIDE/data/DefaultColorSchemes/Dark Mode.prefs index b9e49a26..d5c17c2b 100644 --- a/PureBasicIDE/data/DefaultColorSchemes/Dark Mode.prefs +++ b/PureBasicIDE/data/DefaultColorSchemes/Dark Mode.prefs @@ -1,13 +1,14 @@ ; Dark Mode -; Color scheme for PureBasic IDE - +; [Sections] IncludeColors = 1 - +; +; Color settings +; [Colors] ASMKeywordColor = RGB(255, 125, 120) ASMKeywordColor_Used = 1 -BackgroundColor = RGB(34, 40, 42) +BackgroundColor = RGB(30, 30, 30) BackgroundColor_Used = 1 BasicKeywordColor = RGB(147, 199, 99) BasicKeywordColor_Used = 1 @@ -33,13 +34,13 @@ StringColor = RGB(236, 118, 0) StringColor_Used = 1 StructureColor = RGB(153, 163, 138) StructureColor_Used = 1 -LineNumberColor = RGB(63, 78, 73) +LineNumberColor = RGB(101, 101, 101) LineNumberColor_Used = 1 -LineNumberBackColor = RGB(41, 49, 52) +LineNumberBackColor = RGB(40, 40, 40) LineNumberBackColor_Used = 1 MarkerColor = RGB(0, 170, 170) MarkerColor_Used = 1 -CurrentLineColor = RGB(34, 40, 42) +CurrentLineColor = RGB(40, 40, 40) CurrentLineColor_Used = 1 SelectionColor = RGB(79, 97, 100) SelectionColor_Used = 1 @@ -59,13 +60,13 @@ Debugger_BreakPointColor = RGB(150, 58, 70) Debugger_BreakPointColor_Used = 1 Debugger_BreakpoinSymbolColor = RGB(150, 58, 70) Debugger_BreakpoinSymbolColor_Used = 1 -DisabledBackColor = RGB(63, 78, 73) +DisabledBackColor = RGB(70, 70, 70) DisabledBackColor_Used = 1 GoodBraceColor = RGB(0, 102, 102) GoodBraceColor_Used = 1 BadBraceColor = RGB(255, 0, 0) BadBraceColor_Used = 1 -ProcedureBackColor = RGB(34, 40, 42) +ProcedureBackColor = RGB(30, 30, 30) ProcedureBackColor_Used = 1 CustomKeywordColor = RGB(147, 199, 99) CustomKeywordColor_Used = 1 @@ -81,6 +82,5 @@ SelectionRepeatColor = RGB(70, 70, 89) SelectionRepeatColor_Used = 1 PlainBackground = RGB(0, 0, 0) PlainBackground_Used = 1 - ToolsPanel_FrontColor = RGB(255, 255, 255) -ToolsPanel_BackColor = RGB(34, 40, 42) +ToolsPanel_BackColor = RGB(30, 30, 30)