From 40e76e51a76296e670b6a9460d1092dffc9e8845 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Sat, 25 Jul 2020 11:14:50 +0300 Subject: [PATCH] Improve style and remove source on second click --- applications/gui2/src/modules/addsource.cpp | 6 +++++- applications/gui2/src/modules/themes.cpp | 10 +++++----- applications/gui2/src/views/addsource.cpp | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/applications/gui2/src/modules/addsource.cpp b/applications/gui2/src/modules/addsource.cpp index c47599066..2bbc90ef7 100644 --- a/applications/gui2/src/modules/addsource.cpp +++ b/applications/gui2/src/modules/addsource.cpp @@ -21,7 +21,11 @@ void AddCtrl::show() { } ftl::Configurable *AddCtrl::add(const std::string &uri) { - io->feed()->add(uri); + if (io->feed()->sourceActive(uri)) { + io->feed()->remove(uri); + } else { + io->feed()->add(uri); + } return nullptr; } diff --git a/applications/gui2/src/modules/themes.cpp b/applications/gui2/src/modules/themes.cpp index ee711a686..87ed20bbc 100644 --- a/applications/gui2/src/modules/themes.cpp +++ b/applications/gui2/src/modules/themes.cpp @@ -68,13 +68,13 @@ void Themes::init() { windowtheme_dark->mButtonGradientBotUnfocused = nanogui::Color(30,30,40,180); windowtheme_dark->mButtonGradientTopFocused = nanogui::Color(60,255); windowtheme_dark->mButtonGradientTopUnfocused = nanogui::Color(30,30,40,180); - windowtheme_dark->mButtonGradientTopPushed = nanogui::Color(60,180); - windowtheme_dark->mButtonGradientBotPushed = nanogui::Color(60,180); + windowtheme_dark->mButtonGradientTopPushed = nanogui::Color(90,180); + windowtheme_dark->mButtonGradientBotPushed = nanogui::Color(90,180); windowtheme_dark->mButtonFontSize = 16; windowtheme_dark->mIconScale = 0.85f; - windowtheme_dark->mBorderDark = nanogui::Color(90,255); - windowtheme_dark->mBorderMedium = nanogui::Color(90,255); - windowtheme_dark->mBorderLight = nanogui::Color(90,255); + windowtheme_dark->mBorderDark = nanogui::Color(20,0); + windowtheme_dark->mBorderMedium = nanogui::Color(20,0); + windowtheme_dark->mBorderLight = nanogui::Color(20,0); auto* mediatheme = screen->getTheme("media"); mediatheme->mIconScale = 1.2f; diff --git a/applications/gui2/src/views/addsource.cpp b/applications/gui2/src/views/addsource.cpp index 321a1ccf1..83fb59d9b 100644 --- a/applications/gui2/src/views/addsource.cpp +++ b/applications/gui2/src/views/addsource.cpp @@ -56,7 +56,7 @@ nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widg switch (uri.getScheme()) { case ftl::URI::SCHEME_DEVICE : icon = ENTYPO_ICON_CAMERA; break; case ftl::URI::SCHEME_FILE : icon = ENTYPO_ICON_FOLDER_VIDEO; break; - case ftl::URI::SCHEME_FTL : icon = ENTYPO_ICON_HOME; break; + case ftl::URI::SCHEME_FTL : icon = ENTYPO_ICON_CLOUD; break; case ftl::URI::SCHEME_WS : case ftl::URI::SCHEME_TCP : icon = ENTYPO_ICON_CLASSIC_COMPUTER; break; default: break; -- GitLab