Skip to content

Commit

Permalink
Some changes were reverted. FIXED.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tourahi committed Dec 17, 2023
1 parent 9ad65ca commit b1a1f23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Controls/Frame.moon
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Frame extends Content
@toolBarColor = t.frame.toolBarColor
@toolBarColorUnfocused = t.frame.toolBarColorUnfocused
@backgroundColor = t.frame.contentBackground

@toolBarTitleColor = t.frame.toolBarTitleColor
@closeBtn = Button "Box"

with @closeBtn
Expand All @@ -61,13 +61,18 @@ class Frame extends Content
@setDrag true
@setMakeTopWhenClicked true

@setToolBarTitle label, math.ceil(@toolBarHeight/2)

onDraw: =>
drawToolBar @

box = @getBoundingBox!
r, g, b, a = Graphics.getColor!
boxW, boxH = box\getWidth!, box\getHeight!

Graphics.setColor @toolBarTitleColor
Graphics.draw @toolBarTitle, box.x + @titleOffSet, box.y + @titleOffSet

Graphics.setColor @backgroundColor
Graphics.rectangle "fill", box.x, box.y + @toolBarHeight, boxW, boxH - @toolBarHeight, @rx, @ry

Expand Down Expand Up @@ -107,12 +112,11 @@ class Frame extends Content
manager\setFocus @
@onFocus!

<<<<<<< HEAD
onClick: =>
manager\setFocus @
@onFocus!

setToolBarTitle: (text = @text, size, font) =>
setToolBarTitle: (text = @text, size = 15, font) =>
if size and font
if type(font) == "number" then @font = Graphics.newFont font
if type(font) == "string" then @font = Graphics.newFont font, size
Expand All @@ -123,7 +127,5 @@ class Frame extends Content

@titleOffSet = math.floor ((@toolBarHeight-1) / 2) - (size/2)

=======
>>>>>>> parent of 36c498a (Frame toolbar title.)

Frame
1 change: 1 addition & 0 deletions Controls/themes/blues.moon
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Default =
toolBarColor: {0.161, 0.29, 0.478}
toolBarColorUnfocused: {0.62, 0.62, 0.576}
contentBackground: {0.082, 0.086, 0.09}
toolBarTitleColor: {1, 1, 1}

button:
width: 100
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Control.moon
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ class Control

if @childrenEnabled
for i = #@children, 1, -1
control = @children[i]
hitControl = control\hitTest x, y
hitControl = @children[i]\hitTest x, y
if hitControl then return hitControl

if @enabled
Expand Down Expand Up @@ -449,6 +448,7 @@ class Control
@children[i]\setParent nil
Tremove @children, i
child.events\dispatch child.events\getEvent "UI_ON_REMOVE"
child = nil
break

--- drops the control children.
Expand Down

0 comments on commit b1a1f23

Please sign in to comment.