Skip to content

Commit

Permalink
[Qt] Ensure text margins in current time display are zero
Browse files Browse the repository at this point in the history
Some Qt themes, namely Adwaita, mess with QLineEdit text margins after the
size of the widget has been calculated, squeezing content partially out of
view of a fixed size. Reset margins back to zero behind their back.
  • Loading branch information
eumagga0x2a committed Mar 7, 2021
1 parent 8749501 commit 991bd96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions avidemux/qt4/ADM_UIs/src/DIA_flyDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ bool ADM_flyDialog::addControl(QHBoxLayout *horizontalLayout_4)
{
_parent->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum));
_control=new flyControl(horizontalLayout_4);
_parent->adjustSize(); // force currentTime size calculation
_control->currentTime->setTextMargins(0,0,0,0); // counteract Adwaita messing with text margins

QObject::connect(_control->pushButton_next ,SIGNAL(clicked()),this,SLOT(nextImage()));
QObject::connect(_control->pushButton_back1mn ,SIGNAL(clicked()),this,SLOT(backOneMinute()));
QObject::connect(_control->pushButton_fwd1mn ,SIGNAL(clicked()),this,SLOT(fwdOneMinute()));
Expand Down
1 change: 1 addition & 0 deletions avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ MainWindow::MainWindow(const vector<IScriptEngine*>& scriptEngines) : _scriptEng
widgetsUpdateTooltips();

this->adjustSize();
ui.currentTime->setTextMargins(0,0,0,0); // some Qt themes mess with text margins

threshold = RESIZE_THRESHOLD;
actZoomCalled = false;
Expand Down

0 comments on commit 991bd96

Please sign in to comment.