[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kst-plot] src: HiDPI fixes for data wizard first page.
From:       Barth Netterfield <netterfield () astro ! utoronto ! ca>
Date:       2016-01-31 22:00:53
Message-ID: E1aQ03B-0006TV-PX () scm ! kde ! org
[Download RAW message or body]

Git commit 883cd08469d8751dfab8cbac298dc8ed22a602bd by Barth Netterfield.
Committed on 30/01/2016 at 21:20.
Pushed by netterfield into branch 'master'.

HiDPI fixes for data wizard first page.

M  +3    -0    src/libkstapp/datawizard.cpp
M  +3    -3    src/libkstapp/datawizardpagedatasource.ui
M  +18   -5    src/libkstapp/equationtab.ui
M  +10   -3    src/widgets/datasourceselector.cpp

http://commits.kde.org/kst-plot/883cd08469d8751dfab8cbac298dc8ed22a602bd

diff --git a/src/libkstapp/datawizard.cpp b/src/libkstapp/datawizard.cpp
index 4f76162..9ce673a 100644
--- a/src/libkstapp/datawizard.cpp
+++ b/src/libkstapp/datawizard.cpp
@@ -66,6 +66,9 @@ DataWizardPageDataSource::DataWizardPageDataSource(ObjectStore *store, QWidget *
   _updateBox->addItem(tr("Change Detection", "update when a change is detected"));
   _updateBox->addItem(tr("No Update", "do not update the file"));
   updateUpdateBox();
+
+  int h = fontMetrics().lineSpacing();
+  _url->setFixedHeight(h*4/3);
 }
 
 
diff --git a/src/libkstapp/datawizardpagedatasource.ui b/src/libkstapp/datawizardpagedatasource.ui
index e1c9a6d..df2ea8c 100644
--- a/src/libkstapp/datawizardpagedatasource.ui
+++ b/src/libkstapp/datawizardpagedatasource.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>670</width>
-    <height>420</height>
+    <width>850</width>
+    <height>569</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -45,7 +45,7 @@ p, li { white-space: pre-wrap; }
      <item>
       <widget class="Kst::DataSourceSelector" name="_url" native="true">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
diff --git a/src/libkstapp/equationtab.ui b/src/libkstapp/equationtab.ui
index b242831..9641441 100644
--- a/src/libkstapp/equationtab.ui
+++ b/src/libkstapp/equationtab.ui
@@ -6,11 +6,14 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>648</width>
+    <width>765</width>
     <height>360</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="0">
+    <widget class="Kst::CurveAppearance" name="_curveAppearance" native="true"/>
+   </item>
    <item row="0" column="0" colspan="2">
     <widget class="QGroupBox" name="GroupBox14">
      <property name="title">
@@ -26,7 +29,7 @@
          </sizepolicy>
         </property>
         <property name="text">
-         <string>Eq&amp;uation:</string>
+         <string>E&amp;quation:</string>
         </property>
         <property name="wordWrap">
          <bool>false</bool>
@@ -85,10 +88,20 @@
      </layout>
     </widget>
    </item>
-   <item row="1" column="0">
-    <widget class="Kst::CurveAppearance" name="_curveAppearance" native="true"/>
+   <item row="2" column="0">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
    </item>
-   <item row="1" column="1">
+   <item row="1" column="1" rowspan="2">
     <widget class="Kst::CurvePlacement" name="_curvePlacement" native="true"/>
    </item>
   </layout>
diff --git a/src/widgets/datasourceselector.cpp b/src/widgets/datasourceselector.cpp
index 150b7ea..3675f5c 100644
--- a/src/widgets/datasourceselector.cpp
+++ b/src/widgets/datasourceselector.cpp
@@ -47,17 +47,23 @@ void DataSourceSelector::setup() {
 
   _fileEdit = new QLineEdit(this);
   _fileButton = new QToolButton(this);
-  _fileButton->setProperty("si","file browse button");
+
+  int h = fontMetrics().lineSpacing()*4/3;
+
+  _fileEdit->setFixedHeight(h);
 
   QHBoxLayout * layout = new QHBoxLayout(this);
   layout->setMargin(0);
   layout->addWidget(_fileEdit);
   layout->addWidget(_fileButton);
+
+  _fileButton->setFixedSize(h,h);
   setLayout(layout);
 
-  int size = style()->pixelMetric(QStyle::PM_SmallIconSize);
+  //int size = style()->pixelMetric(QStyle::PM_SmallIconSize);
+  _fileButton->setFixedSize(h,h);
   _fileButton->setIcon(KstGetIcon("kst_changefile"));
-  _fileButton->setFixedSize(size + 8, size + 8);
+  //qDebug() << "file button small icon size" << size;
 
   setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
   //connect (_fileEdit, SIGNAL(textChanged(const QString &)), this, SIGNAL(changed(const QString &)));
@@ -72,6 +78,7 @@ void DataSourceSelector::setup() {
   completer->setModel(dirModel); 
 
   _fileEdit->setCompleter(completer);
+  setFixedHeight(h);
 }
 
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic