Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions PureBasicIDE/FormDesigner/FormManagement.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 14 additions & 7 deletions PureBasicIDE/FormDesigner/codeviewer.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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)+")"
Expand Down Expand Up @@ -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
Expand Down
64 changes: 49 additions & 15 deletions PureBasicIDE/FormDesigner/declare.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
33 changes: 8 additions & 25 deletions PureBasicIDE/FormDesigner/mainevents.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions PureBasicIDE/FormDesigner/mainwindow.pb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


Procedure FD_InitBasicPropGridRows(gadget = 0)

grid_SetGadgetColor(propgrid, #Grid_Color_LineLight, grid_color_light)

PropGridAddNode(propgrid, i, "Properties")
i + 1

Expand Down
6 changes: 6 additions & 0 deletions PureBasicIDE/FormDesigner/opensave.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions PureBasicIDE/MacExtensions.pb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
22 changes: 11 additions & 11 deletions PureBasicIDE/data/DefaultColorSchemes/Dark Mode.prefs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)