Skip to content
Permalink
Browse files

Fix task manager UI sizes on hidpi displays

  • Loading branch information
nyalldawson committed Jan 9, 2018
1 parent c14e6ca commit 82057b830cc31f620376f4676f689aa4c0a54b6f
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/gui/qgstaskmanagerwidget.cpp
@@ -45,11 +45,14 @@ QgsTaskManagerWidget::QgsTaskManagerWidget( QgsTaskManager *manager, QWidget *pa
mTreeView->setHeaderHidden( true );
mTreeView->setRootIsDecorated( false );
mTreeView->setSelectionBehavior( QAbstractItemView::SelectRows );
mTreeView->setColumnWidth( 2, 28 );
int progressColWidth = fontMetrics().width( "X" ) * 10 * Qgis::UI_SCALE_FACTOR;
mTreeView->setColumnWidth( QgsTaskManagerModel::Progress, progressColWidth );
int statusColWidth = fontMetrics().width( "X" ) * 2 * Qgis::UI_SCALE_FACTOR;
mTreeView->setColumnWidth( QgsTaskManagerModel::Status, statusColWidth );
mTreeView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
mTreeView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
mTreeView->header()->setStretchLastSection( false );
mTreeView->header()->setSectionResizeMode( 0, QHeaderView::Stretch );
mTreeView->header()->setSectionResizeMode( QgsTaskManagerModel::Description, QHeaderView::Stretch );

vLayout->addWidget( mTreeView );

@@ -469,7 +472,9 @@ QgsTaskManagerFloatingWidget::QgsTaskManagerFloatingWidget( QgsTaskManager *mana
{
setLayout( new QVBoxLayout() );
QgsTaskManagerWidget *w = new QgsTaskManagerWidget( manager );
setMinimumSize( 350, 270 );
int minWidth = fontMetrics().width( 'X' ) * 60 * Qgis::UI_SCALE_FACTOR;
int minHeight = fontMetrics().height() * 15 * Qgis::UI_SCALE_FACTOR;
setMinimumSize( minWidth, minHeight );
layout()->addWidget( w );
setStyleSheet( ".QgsTaskManagerFloatingWidget { border-top-left-radius: 8px;"
"border-top-right-radius: 8px; background-color: rgb(0, 0, 0, 70%); }" );
@@ -506,7 +511,7 @@ QgsTaskManagerStatusBarWidget::QgsTaskManagerStatusBarWidget( QgsTaskManager *ma

QSize QgsTaskManagerStatusBarWidget::sizeHint() const
{
int width = 100;
int width = fontMetrics().width( 'X' ) * 10 * Qgis::UI_SCALE_FACTOR;
int height = QToolButton::sizeHint().height();
return QSize( width, height );
}

0 comments on commit 82057b8

Please sign in to comment.
You can’t perform that action at this time.