1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:28:54 +03:00

Added "bottomBarHeight" item to skin

There was already "topBarHeight", but the height of the bottom bar was
still hardcoded.
This commit is contained in:
Maarten ter Huurne 2013-08-14 12:23:15 +02:00
parent 13f91f9b7e
commit 19fc3cb4d1
5 changed files with 20 additions and 13 deletions

View File

@ -1,6 +1,7 @@
wallpaper="blue-zero.png" wallpaper="blue-zero.png"
linkHeight=50 linkHeight=50
topBarHeight=50 topBarHeight=50
bottomBarHeight=21
linkWidth=80 linkWidth=80
topBarBg=#ffffff00 topBarBg=#ffffff00
bottomBarBg=#ffffff00 bottomBarBg=#ffffff00

View File

@ -5,5 +5,6 @@ messageBoxBg=#00000080
messageBoxSelection=#fffffff80 messageBoxSelection=#fffffff80
bottomBarBg=#ffffff80 bottomBarBg=#ffffff80
topBarHeight=50 topBarHeight=50
bottomBarHeight=21
linkHeight=50 linkHeight=50
linkWidth=80 linkWidth=80

View File

@ -5,5 +5,6 @@ messageBoxBg=#00000080
messageBoxSelection=#fffffff80 messageBoxSelection=#fffffff80
bottomBarBg=#ffffff80 bottomBarBg=#ffffff80
topBarHeight=50 topBarHeight=50
bottomBarHeight=21
linkHeight=50 linkHeight=50
linkWidth=80 linkWidth=80

View File

@ -813,9 +813,10 @@ void GMenu2X::setSkin(const string &skin, bool setWallpaper) {
} }
} }
evalIntConf( &skinConfInt["topBarHeight"], 40, 32,120 ); evalIntConf(&skinConfInt["topBarHeight"], 40, 32, 120);
evalIntConf( &skinConfInt["linkHeight"], 40, 32,120 ); evalIntConf(&skinConfInt["bottomBarHeight"], 20, 20, 120);
evalIntConf( &skinConfInt["linkWidth"], 60, 32,120 ); evalIntConf(&skinConfInt["linkHeight"], 40, 32, 120);
evalIntConf(&skinConfInt["linkWidth"], 60, 32, 120);
if (menu != NULL) menu->skinUpdated(); if (menu != NULL) menu->skinUpdated();
@ -1195,8 +1196,8 @@ void GMenu2X::drawScrollBar(uint pageSize, uint totalSize, uint pagePos) {
} }
const uint top = skinConfInt["topBarHeight"] + 1; const uint top = skinConfInt["topBarHeight"] + 1;
const uint bottomBarHeight = 21; const uint bottom = skinConfInt["bottomBarHeight"] + 1;
const uint height = resY - top - (bottomBarHeight + 1); const uint height = resY - top - bottom;
s->rectangle(resX - 8, top, 7, height, skinConfColors[COLOR_SELECTION_BG]); s->rectangle(resX - 8, top, 7, height, skinConfColors[COLOR_SELECTION_BG]);
@ -1209,17 +1210,20 @@ void GMenu2X::drawScrollBar(uint pageSize, uint totalSize, uint pagePos) {
void GMenu2X::drawTopBar(Surface *s) { void GMenu2X::drawTopBar(Surface *s) {
Surface *bar = sc.skinRes("imgs/topbar.png", false); Surface *bar = sc.skinRes("imgs/topbar.png", false);
if (bar != NULL) if (bar) {
bar->blit(s, 0, 0); bar->blit(s, 0, 0);
else } else {
s->box(0, 0, resX, skinConfInt["topBarHeight"], const int h = skinConfInt["topBarHeight"];
skinConfColors[COLOR_TOP_BAR_BG]); s->box(0, 0, resX, h, skinConfColors[COLOR_TOP_BAR_BG]);
}
} }
void GMenu2X::drawBottomBar(Surface *s) { void GMenu2X::drawBottomBar(Surface *s) {
Surface *bar = sc.skinRes("imgs/bottombar.png", false); Surface *bar = sc.skinRes("imgs/bottombar.png", false);
if (bar != NULL) if (bar) {
bar->blit(s, 0, resY-bar->height()); bar->blit(s, 0, resY-bar->height());
else } else {
s->box(0, resY-20, resX, 20, skinConfColors[COLOR_BOTTOM_BAR_BG]); const int h = skinConfInt["bottomBarHeight"];
s->box(0, resY - h, resX, h, skinConfColors[COLOR_BOTTOM_BAR_BG]);
}
} }

View File

@ -185,7 +185,7 @@ void Menu::paint(Surface &s) {
ConfIntHash &skinConfInt = gmenu2x->skinConfInt; ConfIntHash &skinConfInt = gmenu2x->skinConfInt;
const int topBarHeight = skinConfInt["topBarHeight"]; const int topBarHeight = skinConfInt["topBarHeight"];
const int bottomBarHeight = 21; const int bottomBarHeight = skinConfInt["bottomBarHeight"];
const int linkWidth = skinConfInt["linkWidth"]; const int linkWidth = skinConfInt["linkWidth"];
const int linkHeight = skinConfInt["linkHeight"]; const int linkHeight = skinConfInt["linkHeight"];
RGBAColor &selectionBgColor = gmenu2x->skinConfColors[COLOR_SELECTION_BG]; RGBAColor &selectionBgColor = gmenu2x->skinConfColors[COLOR_SELECTION_BG];