From 2801fcac9cff3594d259c7b7fcf5c1f75be6b370 Mon Sep 17 00:00:00 2001 From: Jeremy Bullock Date: Jun 19 2019 07:29:09 +0000 Subject: Stop Width Change on Film Strip on Maximize --- diff --git a/toonz/sources/toonzqt/docklayout.cpp b/toonz/sources/toonzqt/docklayout.cpp index ffb0b69..b5d7c2a 100644 --- a/toonz/sources/toonzqt/docklayout.cpp +++ b/toonz/sources/toonzqt/docklayout.cpp @@ -423,10 +423,26 @@ void DockLayout::applyTransform(const QTransform &transform) { //------------------------------------------------------ void DockLayout::redistribute() { + std::vector widgets; if (!m_regions.empty()) { // Recompute extremal region sizes // NOTA: Sarebbe da fare solo se un certo flag lo richiede; altrimenti tipo // per resize events e' inutile... + + // let's force the width of the film strip not to change + + for (int i = 0; i < m_items.size(); i++) { + if (m_items.at(i)->widget() != 0) { + QWidget *widget = m_items.at(i)->widget(); + if (widget) { + std::string name = widget->objectName().toStdString(); + if (widget->objectName() == "FilmStrip") { + widgets.push_back(widget); + widget->setFixedWidth(widget->width()); + } + } + } + } m_regions.front()->calculateExtremalSizes(); int parentWidth = contentsRect().width(); @@ -447,6 +463,10 @@ void DockLayout::redistribute() { // Finally, apply Region geometries found applyGeometry(); + for (QWidget *widget : widgets) { + widget->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + widget->setMinimumSize(0, 0); + } } //======================================================================