Skip to content

Commit

Permalink
Moving panels around
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdulon committed Oct 10, 2020
1 parent 46b2a99 commit ee2cd3d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 81 deletions.
25 changes: 13 additions & 12 deletions LuaMenu/widgets/chobby/components/interface_root.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,26 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
children = {}
}

local status_volumePanel = Control:New {
--y = 0,
height = 32,
width = 180,
right = 225, --?????
top = panelButtonsHeight,
local status_volumePanel = Panel:New {
y = 5,
height = 36,
width = 205,
right = 10, --225, --?????
--top = panelButtonsHeight,
padding = {0, 0, 0, 0},
parent = holder_status,
children = {
WG.VolumePanel.GetControl(),
}
}

local status_userWindow = Control:New {
y = 0,
right = 0,
bottom = panelButtonsHeight,
width = userStatusWidth,
padding = {0, 0, 0, 0},
local status_userWindow = Panel:New {
--y = 40,
height = 30,
right = 10,
bottom = panelButtonsHeight + 5,
width = userStatusWidth+75,
padding = {0, 2, 0, 0},
parent = holder_status,
children = {
WG.UserStatusPanel.GetControl(),
Expand Down
25 changes: 6 additions & 19 deletions LuaMenu/widgets/gui_user_status_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,19 @@ local function InitializeControls(window)
btnLogout = Button:New {
y = 2,
right = 3,
width = 108,
height = 38,
width = 70, --108,
height = 20, --38,
caption = i18n("login"),
parent = window,
font = WG.Chobby.Configuration:GetFont(3),
font = WG.Chobby.Configuration:GetFont(2), --(3)
OnClick = {Logout}
}

if WG.Chobby.Configuration.gameConfig.link_homePage ~= nil then
btnProfile = Button:New {
y = 2,
right = 114,
width = 108,
height = 38,
caption = i18n("home"),
parent = window,
font = WG.Chobby.Configuration:GetFont(3),
OnClick = {GoToProfilePage}
}
end

connectivityText = TextBox:New {
name = "connectivityText",
x = 40,
width = 150,
y = 53,
y = 3, --53,
height = 20,
valign = "center",
text = "\255\180\180\180" .. i18n("offline") .. "\b",
Expand All @@ -126,7 +113,7 @@ local function InitializeControls(window)
connectivityImage = Image:New {
name = "connectivityImage",
x = 15,
y = 52,
y = 2, --52,
width = 18,
height = 18,
keepAspect = false,
Expand All @@ -137,7 +124,7 @@ local function InitializeControls(window)
local userControl
onAccepted = function(listener)
userControl = WG.UserHandler.GetStatusUser(lobby:GetMyUserName())
userControl:SetPos(40, 51, 190)
userControl:SetPos(40, 1, 190) --(40, 51, 190)
window:AddChild(userControl)
window:RemoveChild(connectivityText)
lobby:Ping()
Expand Down
60 changes: 10 additions & 50 deletions LuaMenu/widgets/gui_volume_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ local function InitializeControls(window)
lblClock = Label:New{name = 'lblClock', caption = 'Clock', width = 45, height = 26, textColor = TEXT_COLOR}
trackbarVolume = Trackbar:New{
tooltip = 'Volume',
height = 16, --12,
width = sliderWidth - 25,
height = 16,
width = sliderWidth,
trackColor = TEXT_COLOR,
value = spGetConfigInt("snd_volmaster", 50),
OnChange = {
function(self)
spSetConfigInt("snd_volmaster", self.value)
-- spSendCommands{"set snd_volmaster " .. self.value}
end
},
}
trackbarMusic = Trackbar:New{
tooltip = 'Music',
height = 16, --12,
width = sliderWidth - 25,
height = 16,
width = sliderWidth,
min = 0,
max = 1,
step = 0.01,
Expand Down Expand Up @@ -89,13 +88,13 @@ local function InitializeControls(window)
-- parent = window,
}
local gridVolume = Grid:New{
height = 32, --24,
width = sliderWidth, -- - 25,
height = '100%',
width = sliderWidth + 25,
columns = 2,
rows = 2,
resizeItems = false,
margin = {0, 0, 0, 0},
padding = {0, 0, 0, 0}, --{0, -2, 0, 0},
padding = {0, 0, 0, 0},
itemPadding = {0, 0, 0, 0},
itemMargin = {0, 0, 0, 0},
children = {imageVolume, trackbarVolume, imageMusic, trackbarMusic},
Expand All @@ -111,50 +110,11 @@ local function InitializeControls(window)
resizeItems = false,
autoArrangeV = false,
autoArrangeH = false,
padding = {0, 2, 0, 0},
itemMargin = {1, 0, 0, 0},
children = {stackClock, gridVolume},
padding = {0, 0, 0, 0},
itemMargin = {0, 0, 0, 0},
children = {gridVolume, stackClock},
parent = window,
}
-- local stackChildren = {}
-- local holderWidth = 6
-- if width > 435 then
-- stackChildren[#stackChildren + 1] = stackClock
-- holderWidth = holderWidth + 64
-- end
---- stackChildren[#stackChildren + 1] = imageVolume
-- stackChildren[#stackChildren + 1] = gridVolume
-- holderWidth = holderWidth + sliderWidth + 2
--
-- local mainPanel = Panel:New{
-- y = 0,
-- right = 0,
-- bottom = 0,
---- clientWidth = holderWidth,
-- backgroundColor = INVISIBLE_COLOR,
-- color = INVISIBLE_COLOR,
-- margin = {0, 0, 0, 0},
-- padding = {0, 0, 3, 6},
-- parent = window,
--
-- children = {
-- StackPanel:New{
-- name = 'stack_main',
-- orientation = 'horizontal',
-- width = '100%',
-- height = '100%',
-- resizeItems = false,
-- padding = {0, 0, 0, 0},
-- itemPadding = {1, 1, 1, 1},
-- itemMargin = {1, 1, 1, 1},
-- autoArrangeV = false,
-- autoArrangeH = false,
--
-- children = stackChildren,
---- children = {stackClock, gridVolume},
-- }
-- }
-- }
end


Expand Down

0 comments on commit ee2cd3d

Please sign in to comment.