From d30ff220f64b763392dbf5479cbc1e54a96d1771 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Feb 2014 14:04:22 +0100 Subject: [PATCH] Fix market anchoring, closes #464 --- modules/game_market/market.lua | 9 +++-- .../game_market/ui/general/markettabs.otui | 37 +++++++++++++++++++ modules/game_market/ui/marketoffers.otui | 2 +- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/modules/game_market/market.lua b/modules/game_market/market.lua index a03aa32b..abdeaa47 100644 --- a/modules/game_market/market.lua +++ b/modules/game_market/market.lua @@ -630,14 +630,15 @@ local function initInterface() displaysTabBar = marketOffersPanel:getChildById('rightTabBar') displaysTabBar:setContentWidget(marketOffersPanel:getChildById('rightTabContent')) - itemOffersPanel = g_ui.loadUI('ui/marketoffers/itemoffers') - displaysTabBar:addTab(tr('Offers'), itemOffersPanel) + itemStatsPanel = g_ui.loadUI('ui/marketoffers/itemstats') + displaysTabBar:addTab(tr('Statistics'), itemStatsPanel) itemDetailsPanel = g_ui.loadUI('ui/marketoffers/itemdetails') displaysTabBar:addTab(tr('Details'), itemDetailsPanel) - itemStatsPanel = g_ui.loadUI('ui/marketoffers/itemstats') - displaysTabBar:addTab(tr('Statistics'), itemStatsPanel) + itemOffersPanel = g_ui.loadUI('ui/marketoffers/itemoffers') + displaysTabBar:addTab(tr('Offers'), itemOffersPanel) + displaysTabBar:selectTab(displaysTabBar:getTab(tr('Offers'))) -- setup 'My Offer' section tabs myOffersPanel = g_ui.loadUI('ui/myoffers') diff --git a/modules/game_market/ui/general/markettabs.otui b/modules/game_market/ui/general/markettabs.otui index 2e0e3d5e..e62c7e47 100644 --- a/modules/game_market/ui/general/markettabs.otui +++ b/modules/game_market/ui/general/markettabs.otui @@ -23,3 +23,40 @@ MarketTabBarButton < TabBarButton $on !checked: color: #f55e5e + +MarketRightTabBar < TabBar +MarketRightTabBarPanel < TabBarPanel +// TODO: inherit style from TabBarButton and adjust it +// anchors.left: none did not seem to work for me +MarketRightTabBarButton < UIButton + size: 20 25 + font: verdana-11px-rounded + text-offset: 0 2 + image-source: /images/ui/tabbutton_square + image-color: white + image-clip: 0 0 20 20 + image-border: 3 + icon-color: white + color: #aaaaaa + anchors.top: parent.top + padding: 5 + + anchors.right: prev.left + + $first: + anchors.right: parent.right + + $hover !checked: + image-clip: 0 20 20 20 + color: white + + $disabled: + image-color: #ffffff66 + icon-color: #888888 + + $checked: + image-clip: 0 20 20 20 + color: #ffffff + + $on !checked: + color: #f55e5e diff --git a/modules/game_market/ui/marketoffers.otui b/modules/game_market/ui/marketoffers.otui index 046a8cc7..f4e10b4a 100644 --- a/modules/game_market/ui/marketoffers.otui +++ b/modules/game_market/ui/marketoffers.otui @@ -16,7 +16,7 @@ Panel border-width: 1 border-color: #000000 - MarketTabBar + MarketRightTabBar id: rightTabBar width: 166 height:25