mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 23:42:57 +00:00
Add "Open Folder" button in Preferences > Theme section
This commit is contained in:
parent
83fe139600
commit
c37c790b47
@ -144,6 +144,7 @@
|
||||
<hbox>
|
||||
<button id="select_theme" text="&Select" width="60" />
|
||||
<boxfiller />
|
||||
<button id="open_theme_folder" text="Open &Folder" width="100" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
|
@ -156,6 +156,7 @@ public:
|
||||
|
||||
// Theme buttons
|
||||
selectTheme()->Click.connect(Bind<void>(&OptionsWindow::onSelectTheme, this));
|
||||
openThemeFolder()->Click.connect(Bind<void>(&OptionsWindow::onOpenThemeFolder, this));
|
||||
|
||||
onChangeGridScope();
|
||||
sectionListbox()->selectIndex(m_curSection);
|
||||
@ -333,9 +334,7 @@ private:
|
||||
if (themeList()->getItemsCount() > 0)
|
||||
return;
|
||||
|
||||
ResourceFinder rf;
|
||||
rf.includeDataDir("skins");
|
||||
std::string path = rf.defaultFilename();
|
||||
std::string path = themeFolder();
|
||||
for (auto& fn : base::list_files(path)) {
|
||||
if (!base::is_directory(base::join_path(path, fn)))
|
||||
continue;
|
||||
@ -365,6 +364,20 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void onOpenThemeFolder() {
|
||||
ui::Alert::show(PACKAGE
|
||||
"<<%s"
|
||||
"||&OK", themeFolder().c_str());
|
||||
|
||||
launcher::open_folder(themeFolder());
|
||||
}
|
||||
|
||||
static std::string themeFolder() {
|
||||
ResourceFinder rf;
|
||||
rf.includeDataDir("skins");
|
||||
return rf.defaultFilename();
|
||||
}
|
||||
|
||||
Preferences& m_preferences;
|
||||
DocumentPreferences& m_globPref;
|
||||
DocumentPreferences& m_docPref;
|
||||
|
Loading…
x
Reference in New Issue
Block a user