Skip to content

Commit ee2cd3d

Browse files
committed
Moving panels around
1 parent 46b2a99 commit ee2cd3d

File tree

3 files changed

+29
-81
lines changed

3 files changed

+29
-81
lines changed

LuaMenu/widgets/chobby/components/interface_root.lua

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,25 +178,26 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
178178
children = {}
179179
}
180180

181-
local status_volumePanel = Control:New {
182-
--y = 0,
183-
height = 32,
184-
width = 180,
185-
right = 225, --?????
186-
top = panelButtonsHeight,
181+
local status_volumePanel = Panel:New {
182+
y = 5,
183+
height = 36,
184+
width = 205,
185+
right = 10, --225, --?????
186+
--top = panelButtonsHeight,
187187
padding = {0, 0, 0, 0},
188188
parent = holder_status,
189189
children = {
190190
WG.VolumePanel.GetControl(),
191191
}
192192
}
193193

194-
local status_userWindow = Control:New {
195-
y = 0,
196-
right = 0,
197-
bottom = panelButtonsHeight,
198-
width = userStatusWidth,
199-
padding = {0, 0, 0, 0},
194+
local status_userWindow = Panel:New {
195+
--y = 40,
196+
height = 30,
197+
right = 10,
198+
bottom = panelButtonsHeight + 5,
199+
width = userStatusWidth+75,
200+
padding = {0, 2, 0, 0},
200201
parent = holder_status,
201202
children = {
202203
WG.UserStatusPanel.GetControl(),

LuaMenu/widgets/gui_user_status_panel.lua

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,32 +90,19 @@ local function InitializeControls(window)
9090
btnLogout = Button:New {
9191
y = 2,
9292
right = 3,
93-
width = 108,
94-
height = 38,
93+
width = 70, --108,
94+
height = 20, --38,
9595
caption = i18n("login"),
9696
parent = window,
97-
font = WG.Chobby.Configuration:GetFont(3),
97+
font = WG.Chobby.Configuration:GetFont(2), --(3)
9898
OnClick = {Logout}
9999
}
100100

101-
if WG.Chobby.Configuration.gameConfig.link_homePage ~= nil then
102-
btnProfile = Button:New {
103-
y = 2,
104-
right = 114,
105-
width = 108,
106-
height = 38,
107-
caption = i18n("home"),
108-
parent = window,
109-
font = WG.Chobby.Configuration:GetFont(3),
110-
OnClick = {GoToProfilePage}
111-
}
112-
end
113-
114101
connectivityText = TextBox:New {
115102
name = "connectivityText",
116103
x = 40,
117104
width = 150,
118-
y = 53,
105+
y = 3, --53,
119106
height = 20,
120107
valign = "center",
121108
text = "\255\180\180\180" .. i18n("offline") .. "\b",
@@ -126,7 +113,7 @@ local function InitializeControls(window)
126113
connectivityImage = Image:New {
127114
name = "connectivityImage",
128115
x = 15,
129-
y = 52,
116+
y = 2, --52,
130117
width = 18,
131118
height = 18,
132119
keepAspect = false,
@@ -137,7 +124,7 @@ local function InitializeControls(window)
137124
local userControl
138125
onAccepted = function(listener)
139126
userControl = WG.UserHandler.GetStatusUser(lobby:GetMyUserName())
140-
userControl:SetPos(40, 51, 190)
127+
userControl:SetPos(40, 1, 190) --(40, 51, 190)
141128
window:AddChild(userControl)
142129
window:RemoveChild(connectivityText)
143130
lobby:Ping()

LuaMenu/widgets/gui_volume_panel.lua

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,20 @@ local function InitializeControls(window)
4747
lblClock = Label:New{name = 'lblClock', caption = 'Clock', width = 45, height = 26, textColor = TEXT_COLOR}
4848
trackbarVolume = Trackbar:New{
4949
tooltip = 'Volume',
50-
height = 16, --12,
51-
width = sliderWidth - 25,
50+
height = 16,
51+
width = sliderWidth,
5252
trackColor = TEXT_COLOR,
5353
value = spGetConfigInt("snd_volmaster", 50),
5454
OnChange = {
5555
function(self)
5656
spSetConfigInt("snd_volmaster", self.value)
57-
-- spSendCommands{"set snd_volmaster " .. self.value}
5857
end
5958
},
6059
}
6160
trackbarMusic = Trackbar:New{
6261
tooltip = 'Music',
63-
height = 16, --12,
64-
width = sliderWidth - 25,
62+
height = 16,
63+
width = sliderWidth,
6564
min = 0,
6665
max = 1,
6766
step = 0.01,
@@ -89,13 +88,13 @@ local function InitializeControls(window)
8988
-- parent = window,
9089
}
9190
local gridVolume = Grid:New{
92-
height = 32, --24,
93-
width = sliderWidth, -- - 25,
91+
height = '100%',
92+
width = sliderWidth + 25,
9493
columns = 2,
9594
rows = 2,
9695
resizeItems = false,
9796
margin = {0, 0, 0, 0},
98-
padding = {0, 0, 0, 0}, --{0, -2, 0, 0},
97+
padding = {0, 0, 0, 0},
9998
itemPadding = {0, 0, 0, 0},
10099
itemMargin = {0, 0, 0, 0},
101100
children = {imageVolume, trackbarVolume, imageMusic, trackbarMusic},
@@ -111,50 +110,11 @@ local function InitializeControls(window)
111110
resizeItems = false,
112111
autoArrangeV = false,
113112
autoArrangeH = false,
114-
padding = {0, 2, 0, 0},
115-
itemMargin = {1, 0, 0, 0},
116-
children = {stackClock, gridVolume},
113+
padding = {0, 0, 0, 0},
114+
itemMargin = {0, 0, 0, 0},
115+
children = {gridVolume, stackClock},
117116
parent = window,
118117
}
119-
-- local stackChildren = {}
120-
-- local holderWidth = 6
121-
-- if width > 435 then
122-
-- stackChildren[#stackChildren + 1] = stackClock
123-
-- holderWidth = holderWidth + 64
124-
-- end
125-
---- stackChildren[#stackChildren + 1] = imageVolume
126-
-- stackChildren[#stackChildren + 1] = gridVolume
127-
-- holderWidth = holderWidth + sliderWidth + 2
128-
--
129-
-- local mainPanel = Panel:New{
130-
-- y = 0,
131-
-- right = 0,
132-
-- bottom = 0,
133-
---- clientWidth = holderWidth,
134-
-- backgroundColor = INVISIBLE_COLOR,
135-
-- color = INVISIBLE_COLOR,
136-
-- margin = {0, 0, 0, 0},
137-
-- padding = {0, 0, 3, 6},
138-
-- parent = window,
139-
--
140-
-- children = {
141-
-- StackPanel:New{
142-
-- name = 'stack_main',
143-
-- orientation = 'horizontal',
144-
-- width = '100%',
145-
-- height = '100%',
146-
-- resizeItems = false,
147-
-- padding = {0, 0, 0, 0},
148-
-- itemPadding = {1, 1, 1, 1},
149-
-- itemMargin = {1, 1, 1, 1},
150-
-- autoArrangeV = false,
151-
-- autoArrangeH = false,
152-
--
153-
-- children = stackChildren,
154-
---- children = {stackClock, gridVolume},
155-
-- }
156-
-- }
157-
-- }
158118
end
159119

160120

0 commit comments

Comments
 (0)