diff --git a/specter/include/Specter/ModalWindow.hpp b/specter/include/Specter/ModalWindow.hpp index 8c1f25946..9e46ecee3 100644 --- a/specter/include/Specter/ModalWindow.hpp +++ b/specter/include/Specter/ModalWindow.hpp @@ -57,6 +57,7 @@ class ModalWindow : public View protected: virtual void updateContentOpacity(float opacity) {} + RectangleConstraint& constraint() {return m_constraint;} public: ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint, const Zeus::CColor& bgColor); diff --git a/specter/lib/FileBrowser.cpp b/specter/lib/FileBrowser.cpp index 120a327f4..36657a635 100644 --- a/specter/lib/FileBrowser.cpp +++ b/specter/lib/FileBrowser.cpp @@ -117,7 +117,7 @@ void FileBrowser::navigateToPath(const HECL::SystemString& path) return; m_path = path; - m_comps = PathComponents(path); + m_comps = PathComponents(m_path); if (S_ISREG(theStat.st_mode)) { HECL::SystemUTF8View utf8(m_comps.back()); diff --git a/specter/lib/MessageWindow.cpp b/specter/lib/MessageWindow.cpp index 05363170f..5fa187849 100644 --- a/specter/lib/MessageWindow.cpp +++ b/specter/lib/MessageWindow.cpp @@ -8,7 +8,7 @@ namespace Specter MessageWindow::MessageWindow(ViewResources& res, View& parentView, Type type, const std::string& message, std::function func) -: ModalWindow(res, parentView, RectangleConstraint(400 * res.pixelFactor(), 150 * res.pixelFactor()), +: ModalWindow(res, parentView, RectangleConstraint(), type==Type::ErrorOk ? res.themeData().splashErrorBackground() : res.themeData().splashBackground()), m_type(type), m_func(func), m_okBind(*this, rootView().viewManager().translateOr("ok", "OK")), @@ -18,6 +18,7 @@ MessageWindow::MessageWindow(ViewResources& res, View& parentView, m_text.reset(new MultiLineTextView(res, *this, res.m_mainFont, TextView::Alignment::Center)); m_text->typesetGlyphs(message, res.themeData().uiText(), 380 * res.pixelFactor()); + constraint() = RectangleConstraint(400 * res.pixelFactor(), 80 * res.pixelFactor() + m_text->nominalHeight()); m_ok.m_view.reset(new Button(res, *this, &m_okBind, m_okBind.m_name, Button::Style::Block, RectangleConstraint(150 * res.pixelFactor()))); @@ -73,7 +74,7 @@ void MessageWindow::resized(const boo::SWindowRect& root, const boo::SWindowRect ModalWindow::resized(root, sub); boo::SWindowRect buttonRect = subRect(); float pf = rootView().viewRes().pixelFactor(); - buttonRect.location[1] += 25 * pf; + buttonRect.location[1] += 20 * pf; buttonRect.size[0] = m_ok.m_view->nominalWidth(); buttonRect.size[1] = m_ok.m_view->nominalHeight(); if (m_type == Type::ConfirmOkCancel) @@ -91,7 +92,7 @@ void MessageWindow::resized(const boo::SWindowRect& root, const boo::SWindowRect boo::SWindowRect textRect = subRect(); textRect.location[0] += 200 * pf; - textRect.location[1] += 120 * pf; + textRect.location[1] += 65 * pf; m_text->resized(root, textRect); } diff --git a/specter/lib/Table.cpp b/specter/lib/Table.cpp index 96dbd2ca0..639a920d8 100644 --- a/specter/lib/Table.cpp +++ b/specter/lib/Table.cpp @@ -244,7 +244,11 @@ void Table::selectRow(size_t r) Log.report(LogVisor::FatalError, "selectRow out of bounds (%" PRISize ", %" PRISize ")", r, m_rows); if (r == m_selectedRow) + { + if (m_state) + m_state->setSelectedRow(r); return; + } if (m_selectedRow != -1) for (auto& col : m_cellViews) {