Keep the preview centred however long the status line gets
The status line under the preview names every stage of the chain, and a label asks for its whole text as its minimum width. With a long chain that was wider than the pane, so the preview column was laid out wider than it is shown and the picture, centred in it, slid off to the right until a shorter status (such as "Saved ...") let it back. The line is now ellipsized and never asks for more room than it is given; the full text stays readable as its tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -350,6 +350,12 @@ Gtk::Widget& EffectorWindow::buildPreview() {
|
||||
|
||||
auto* box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL);
|
||||
box->append(*overlay);
|
||||
// A long chain makes a long status line; left to its natural width it
|
||||
// would widen the preview column past the pane and push the picture off
|
||||
// centre. Ellipsized, it never asks for more room than it is given.
|
||||
status_.set_ellipsize(Pango::EllipsizeMode::END);
|
||||
status_.set_margin_start(8);
|
||||
status_.set_margin_end(8);
|
||||
status_.set_margin_top(6);
|
||||
status_.set_margin_bottom(8);
|
||||
status_.add_css_class("dim-label");
|
||||
@@ -1400,6 +1406,7 @@ void EffectorWindow::showPlaceholder() {
|
||||
placeholder_.set_text(missingText());
|
||||
previewStack_.set_visible_child("placeholder");
|
||||
status_.set_text("");
|
||||
status_.set_tooltip_text("");
|
||||
}
|
||||
|
||||
void EffectorWindow::requestRender() {
|
||||
@@ -1505,6 +1512,7 @@ void EffectorWindow::onRenderFinished() {
|
||||
}
|
||||
status << "seed " << seed_ << " · " << millis << " ms";
|
||||
status_.set_text(status.str());
|
||||
status_.set_tooltip_text(status.str());
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------- project ---
|
||||
@@ -1679,6 +1687,7 @@ void EffectorWindow::writeProject(const std::string& path) {
|
||||
projectPath_ = path;
|
||||
updateTitle();
|
||||
status_.set_text("Saved " + path);
|
||||
status_.set_tooltip_text("Saved " + path);
|
||||
}
|
||||
|
||||
void EffectorWindow::updateTitle() {
|
||||
@@ -1722,6 +1731,7 @@ void EffectorWindow::onSaveChosen(const Glib::RefPtr<Gio::AsyncResult>& result,
|
||||
}
|
||||
clearError();
|
||||
status_.set_text("Saved " + path.string());
|
||||
status_.set_tooltip_text("Saved " + path.string());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------- errors ---
|
||||
|
||||
Reference in New Issue
Block a user