Commit dc202b78 authored by Supernature2k's avatar Supernature2k Committed by Subs

added icons in quick menu

parent 62600c70
......@@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- Added icons in quick menu
- Added default subset values for recalbox theme
- Added new item to menutheme, menus now fully themable
- Added new subset for menu styles
......
......@@ -177,6 +177,17 @@ bool SystemView::input(InputConfig* config, Input input)
}
}, _("NO"), nullptr));
});
// icon
auto icon1 = std::make_shared<ImageComponent>(mWindow);
icon1->setImage(menuTheme->menuIconSet.restart);
icon1->setColorShift(menuTheme->menuText.color);
icon1->setResize(0, menuTheme->menuText.font->getLetterHeight() * 1.25f);
row.addElement(icon1, false);
// spacer between icon and text
auto spacer = std::make_shared<GuiComponent>(mWindow);
spacer->setSize(10, 0);
row.addElement(spacer, false);
row.addElement(std::make_shared<TextComponent>(window, _("RESTART SYSTEM"), menuTheme->menuText.font, menuTheme->menuText.color), true);
s->addRow(row);
......@@ -190,6 +201,13 @@ bool SystemView::input(InputConfig* config, Input input)
}
}, _("NO"), nullptr));
});
auto icon2 = std::make_shared<ImageComponent>(mWindow);
icon2->setImage(menuTheme->menuIconSet.shutdown);
icon2->setColorShift(menuTheme->menuText.color);
icon2->setResize(0, menuTheme->menuText.font->getLetterHeight() * 1.25f);
row.addElement(icon2, false);
// spacer between icon and text
row.addElement(spacer, false);
row.addElement(std::make_shared<TextComponent>(window, _("SHUTDOWN SYSTEM"), menuTheme->menuText.font, menuTheme->menuText.color), true);
s->addRow(row);
row.elements.clear();
......@@ -202,6 +220,13 @@ bool SystemView::input(InputConfig* config, Input input)
}
}, _("NO"), nullptr));
});
auto icon3 = std::make_shared<ImageComponent>(mWindow);
icon3->setImage(menuTheme->menuIconSet.fastshutdown);
icon3->setColorShift(menuTheme->menuText.color);
icon3->setResize(0, menuTheme->menuText.font->getLetterHeight() * 1.25f);
row.addElement(icon3, false);
// spacer between icon and text
row.addElement(spacer, false);
row.addElement(std::make_shared<TextComponent>(window, _("FAST SHUTDOWN SYSTEM"), menuTheme->menuText.font, menuTheme->menuText.color), true);
s->addRow(row);
mWindow->pushGui(s);
......
......@@ -144,7 +144,16 @@ MenuThemeData::MenuThemeData(){
mCurrent->menuIconSet.advanced = elem->get<std::string>("iconAdvanced");
if (elem->has("iconQuit"))
mCurrent->menuIconSet.quit = elem->get<std::string>("iconQuit");
mCurrent->menuIconSet.quit = elem->get<std::string>("iconQuit");
if (elem->has("iconRestart"))
mCurrent->menuIconSet.restart = elem->get<std::string>("iconRestart");
if (elem->has("iconShutdown"))
mCurrent->menuIconSet.shutdown = elem->get<std::string>("iconShutdown");
if (elem->has("iconFastShutdown"))
mCurrent->menuIconSet.fastshutdown = elem->get<std::string>("iconFastShutdown");
}
......
......@@ -39,6 +39,9 @@ struct MenuIconElement {
std::string scraper;
std::string advanced;
std::string quit;
std::string restart;
std::string shutdown;
std::string fastshutdown;
};
struct MenuTheme {
......@@ -61,4 +64,4 @@ private:
MenuThemeData();
MenuTheme* mCurrent;
static MenuThemeData* sInstance;
};
\ No newline at end of file
};
......@@ -136,7 +136,10 @@ std::map< std::string, ElementMapType > ThemeData::sElementMap = boost::assign::
("iconNetwork", PATH)
("iconScraper", PATH)
("iconAdvanced", PATH)
("iconQuit", PATH)))
("iconQuit", PATH)
("iconRestart", PATH)
("iconShutdown", PATH)
("iconFastShutdown", PATH)))
("menuSwitch", makeMap(boost::assign::map_list_of
("pathOn", PATH)
("pathOff", PATH)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment