Git commit 5b55691eb36f762961f53735218da462be77e72b by Barth Netterfield.
Committed on 30/01/2016 at 20:46.
Pushed by netterfield into branch 'master'.
More HiDPI fixes:
Remove some pixel based magic numbers.
M +8 -7 src/libkstapp/labelcreator.cpp
M +60 -43 src/libkstapp/labelcreator.ui
M +7 -6 src/libkstapp/labelpropertiestab.cpp
M +12 -4 src/libkstapp/labeltab.cpp
M +439 -341 src/libkstapp/labeltab.ui
M +7 -6 src/libkstapp/legendtab.cpp
M +7 -4 src/libkstapp/overridelabeltab.cpp
M +71 -73 src/libkstapp/overridelabeltab.ui
M +8 -6 src/libkstapp/themedialog.cpp
http://commits.kde.org/kst-plot/5b55691eb36f762961f53735218da462be77e72b
diff --git a/src/libkstapp/labelcreator.cpp b/src/libkstapp/labelcreator.cpp
index 76295bc..c8e6e5a 100644
--- a/src/libkstapp/labelcreator.cpp
+++ b/src/libkstapp/labelcreator.cpp
@@ -28,16 +28,17 @@ LabelCreator::LabelCreator(QWidget *parent)
: QDialog(parent) {
=
setupUi(this);
+
setWindowTitle(tr("Create Label Dialog"));
- _bold->setFixedWidth(32);
- _bold->setFixedHeight(32);
+ int h =3D fontMetrics().lineSpacing();
+ _bold->setFixedWidth(h);
+ _bold->setFixedHeight(h);
_bold->setIcon(KstGetIcon("kst_bold"));
- _italic->setFixedWidth(32);
- _italic->setFixedHeight(32);
+ _italic->setFixedWidth(h);
+ _italic->setFixedHeight(h);
_italic->setIcon(KstGetIcon("kst_italic"));
- _labelColor->setFixedWidth(32);
- _labelColor->setFixedHeight(32);
-
+ _labelColor->setFixedWidth(h);
+ _labelColor->setFixedHeight(h);
_labelText->setObjectStore(kstApp->mainWindow()->document()->objectStore=
());
=
QFont font;
diff --git a/src/libkstapp/labelcreator.ui b/src/libkstapp/labelcreator.ui
index f5e6ba6..e595e05 100644
--- a/src/libkstapp/labelcreator.ui
+++ b/src/libkstapp/labelcreator.ui
@@ -52,7 +52,7 @@
- Left
+ &Left
true
@@ -79,35 +79,6 @@
-
-
-
-
-
- Bold
-
-
-
-
-
- true
-
-
- label bold
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- points
-
-
-
-
@@ -143,7 +114,7 @@
-
- Font &size:
+ Font si&ze:
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -153,23 +124,38 @@
- -
-
-
- 1
+
-
+
+
+
+ 0
+ 0
+
-
- -25.000000000000000
+
+ Italic
-
- 1.000000000000000
+
+
+
+
+ true
+
+
+ label italic
-
-
+
+
+
+ 0
+ 0
+
+
- Italic
+ Bold
@@ -178,7 +164,39 @@
true
- label italic
+ label bold
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ points
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ 1
+
+
+ -25.000000000000000
+
+
+ 1.000000000000000
@@ -217,7 +235,6 @@
_labelFontScale
- _bold
_labelColor
_family
_saveAsDefault
diff --git a/src/libkstapp/labelpropertiestab.cpp b/src/libkstapp/labelprop=
ertiestab.cpp
index 82f3c70..69df4ab 100644
--- a/src/libkstapp/labelpropertiestab.cpp
+++ b/src/libkstapp/labelpropertiestab.cpp
@@ -40,14 +40,15 @@ LabelPropertiesTab::LabelPropertiesTab(QWidget *parent)
"Scalar: [V1/Mean]. Vector Element=
: [V1[4]]. "
"Equation: [=3D[V1/Mean]^2]. A [ c=
haracter can be inserted as \\[."));
=
- _bold->setFixedWidth(32);
- _bold->setFixedHeight(32);
+ int h =3D fontMetrics().lineSpacing();
+ _bold->setFixedWidth(h);
+ _bold->setFixedHeight(h);
_bold->setIcon(KstGetIcon("kst_bold"));
- _italic->setFixedWidth(32);
- _italic->setFixedHeight(32);
+ _italic->setFixedWidth(h);
+ _italic->setFixedHeight(h);
_italic->setIcon(KstGetIcon("kst_italic"));
- _labelColor->setFixedWidth(32);
- _labelColor->setFixedHeight(32);
+ _labelColor->setFixedWidth(h);
+ _labelColor->setFixedHeight(h);
=
connect(_labelText, SIGNAL(labelChanged()), this, SIGNAL(modified()));
connect(_labelFontScale, SIGNAL(valueChanged(double)), this, SIGNAL(modi=
fied()));
diff --git a/src/libkstapp/labeltab.cpp b/src/libkstapp/labeltab.cpp
index 88ef7d9..7edff91 100644
--- a/src/libkstapp/labeltab.cpp
+++ b/src/libkstapp/labeltab.cpp
@@ -27,12 +27,20 @@ LabelTab::LabelTab(PlotItem* plotItem, QWidget *parent)
=
setupUi(this);
=
+ int h =3D fontMetrics().lineSpacing();
_globalLabelBold->setIcon(KstGetIcon("kst_bold"));
- _globalLabelBold->setFixedWidth(32);
+ _globalLabelBold->setFixedHeight(h);
+ _globalLabelBold->setFixedWidth(h);
_globalLabelItalic->setIcon(KstGetIcon("kst_italic"));
- _globalLabelItalic->setFixedWidth(32);
- _globalLabelColor->setFixedWidth(32);
- _globalLabelColor->setFixedHeight(32);
+ _globalLabelItalic->setFixedHeight(h);
+ _globalLabelItalic->setFixedWidth(h);
+ _globalLabelColor->setFixedHeight(h);
+ _globalLabelColor->setFixedWidth(h);
+
+ _topLabelText->setFixedHeight(h*4/3);
+ _bottomLabelText->setFixedHeight(h*4/3);
+ _leftLabelText->setFixedHeight(h*4/3);
+ _rightLabelText->setFixedHeight(h*4/3);
=
setTabTitle(tr("Labels"));
=
diff --git a/src/libkstapp/labeltab.ui b/src/libkstapp/labeltab.ui
index 526e2a8..98e416d 100644
--- a/src/libkstapp/labeltab.ui
+++ b/src/libkstapp/labeltab.ui
@@ -6,221 +6,447 @@
0
0
- 630
- 364
+ 1155
+ 621
-
- -
-
-
- Default plot font &size:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- _globalLabelFontSize
-
-
-
- -
-
-
- 1
-
-
- -25.000000000000000
-
-
-
- -
-
-
- points
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 22
- 22
-
-
-
- true
-
-
- label bold
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 22
- 22
-
-
-
- true
-
-
- label italic
-
-
-
- -
-
-
- label color
-
-
-
- -
-
-
- -
-
-
- Automatically scale number axis labels
-
-
+
+
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ true
+
+
+ label italic
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ points
+
+
+
+ -
+
+
+ -
+
+
+ 1
+
+
+ -25.000000000000000
+
+
+
+ -
+
+
+ label color
+
+
+
+ -
+
+
+ Font Family:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ true
+
+
+ label bold
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Default plot font si&ze:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ _globalLabelFontSize
+
+
+
+ -
+
+
+ Qt::LeftToRight
+
+
+ Autoscale axis numbers
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
- -
+
-
-
-
- 0
- 0
-
-
Qt::Horizontal
- -
-
-
- &Top label:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- _topLabelText
-
-
-
- -
-
-
- Auto
-
-
- true
-
-
-
- -
-
-
- Botto&m label:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- _bottomLabelText
-
-
-
- -
-
-
- Auto
-
-
- true
-
-
-
- -
-
-
- &Left label:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- _leftLabelText
-
-
-
- -
-
-
- Auto
-
-
- true
-
-
-
- -
-
-
- &Right label:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- _rightLabelText
-
-
-
- -
-
-
- Auto
-
-
- true
-
-
+
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Botto&m label:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ _bottomLabelText
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Auto
+
+
+ true
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 19
+
+
+
+
+ 16777215
+ 22
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QTextEdit::NoWrap
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ &Right label:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ _rightLabelText
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 19
+
+
+
+
+ 16777215
+ 22
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QTextEdit::NoWrap
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Auto
+
+
+ true
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 19
+
+
+
+
+ 16777215
+ 22
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QTextEdit::NoWrap
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ &Left label:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ _leftLabelText
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 19
+
+
+
+
+ 16777215
+ 22
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QTextEdit::NoWrap
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Top &label:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ _topLabelText
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Auto
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Auto
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ true
+
+
+
+ Supports scalars & strings (name in square brackets) -=
eg, [INDEX:Max (X2)],
+embedded equations - eg, [=3D[INDEX:Max] / 2]
+and LaTeX symbols - eg, \theta. Names and symbols are autocompleted.
+
+
+
+
- -
+
-
-
-
- 0
- 0
-
-
Qt::Horizontal
- -
+
-
0
@@ -251,22 +477,22 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
- -
-
-
- Qt::Horizontal
-
-
-
- 376
- 0
-
-
-
-
- -
+
-
Qt::Vertical
@@ -279,132 +505,6 @@
- -
-
-
- false
-
-
-
- 0
- 19
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::ScrollBarAlwaysOff
-
-
- Qt::ScrollBarAlwaysOff
-
-
- QTextEdit::NoWrap
-
-
-
- -
-
-
- false
-
-
-
- 0
- 19
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::ScrollBarAlwaysOff
-
-
- Qt::ScrollBarAlwaysOff
-
-
- QTextEdit::NoWrap
-
-
-
- -
-
-
- false
-
-
-
- 0
- 19
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::ScrollBarAlwaysOff
-
-
- Qt::ScrollBarAlwaysOff
-
-
- QTextEdit::NoWrap
-
-
-
- -
-
-
- false
-
-
-
- 0
- 19
-
-
-
-
- 16777215
- 22
-
-
-
- Qt::ScrollBarAlwaysOff
-
-
- Qt::ScrollBarAlwaysOff
-
-
- QTextEdit::NoWrap
-
-
-
- -
-
-
-
- true
-
-
-
- Supports scalars & strings (name in square brackets) - e=
g, [INDEX:Max (X2)],
-embedded equations - eg, [=3D[INDEX:Max] / 2]
-and LaTeX symbols - eg, \theta. Names and symbols are autocompleted.
-
-
-
@@ -425,7 +525,6 @@ and LaTeX symbols - eg, \theta. Names and symbols are =
autocompleted.
_globalLabelItalic
_globalLabelColor
_globalLabelFontFamily
- _autoScaleNumberAxis
_topLabelAuto
_topLabelText
_bottomLabelAuto
@@ -434,7 +533,6 @@ and LaTeX symbols - eg, \theta. Names and symbols are =
autocompleted.
_leftLabelText
_rightLabelAuto
_rightLabelText
- _showLegend
_editLegendContents
diff --git a/src/libkstapp/legendtab.cpp b/src/libkstapp/legendtab.cpp
index 8ec6d76..3bd4eff 100644
--- a/src/libkstapp/legendtab.cpp
+++ b/src/libkstapp/legendtab.cpp
@@ -34,14 +34,15 @@ LegendTab::LegendTab(QWidget *parent)
_add->setToolTip(tr("Select: Alt+s"));
_remove->setToolTip(tr("Remove: Alt+r"));
=
- _bold->setFixedWidth(32);
- _bold->setFixedHeight(32);
+ int h =3D fontMetrics().lineSpacing();
+ _bold->setFixedWidth(h);
+ _bold->setFixedHeight(h);
_bold->setIcon(KstGetIcon("kst_bold"));
- _italic->setFixedWidth(32);
- _italic->setFixedHeight(32);
+ _italic->setFixedWidth(h);
+ _italic->setFixedHeight(h);
_italic->setIcon(KstGetIcon("kst_italic"));
- _labelColor->setFixedWidth(32);
- _labelColor->setFixedHeight(32);
+ _labelColor->setFixedWidth(h);
+ _labelColor->setFixedHeight(h);
=
=
connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
diff --git a/src/libkstapp/overridelabeltab.cpp b/src/libkstapp/overridelab=
eltab.cpp
index 3866e60..0d92edc 100644
--- a/src/libkstapp/overridelabeltab.cpp
+++ b/src/libkstapp/overridelabeltab.cpp
@@ -24,12 +24,15 @@ OverrideLabelTab::OverrideLabelTab(QString title, QWidg=
et *parent)
: DialogTab(parent), _fontDirty(false) {
=
setupUi(this);
+ int h =3D fontMetrics().lineSpacing();
_bold->setIcon(KstGetIcon("kst_bold"));
- _bold->setFixedWidth(32);
+ _bold->setFixedWidth(h);
+ _bold->setFixedHeight(h);
_italic->setIcon(KstGetIcon("kst_italic"));
- _italic->setFixedWidth(32);
- _labelColor->setFixedWidth(32);
- _labelColor->setFixedHeight(32);
+ _italic->setFixedWidth(h);
+ _italic->setFixedHeight(h);
+ _labelColor->setFixedWidth(h);
+ _labelColor->setFixedHeight(h);
=
setTabTitle(title);
=
diff --git a/src/libkstapp/overridelabeltab.ui b/src/libkstapp/overridelabe=
ltab.ui
index 8984926..2e71c04 100644
--- a/src/libkstapp/overridelabeltab.ui
+++ b/src/libkstapp/overridelabeltab.ui
@@ -6,24 +6,28 @@
0
0
- 451
- 271
+ 1425
+ 858
-
-
- 400
- 0
-
-
-
- -
+
+
-
-
- 0
-
-
-
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ points
+
+
+
+ -
+
false
@@ -33,55 +37,43 @@
0
-
- Font &size:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ true
-
- _fontSize
+
+
- -
-
+
-
+
false
-
- 1
-
-
- -25.000000000000000
-
-
- 1.000000000000000
+
+
- -
-
+
-
+
false
-
+
0
0
-
-
- 22
- 22
-
+
+ Font si&ze:
-
- true
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
- override label italic
+
+ _fontSize
@@ -91,13 +83,13 @@
false
-
+
0
0
- Font famil&y:
+ Font fa&mily:
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -107,14 +99,23 @@
- -
-
+
-
+
false
+
+ 1
+
+
+ -25.000000000000000
+
+
+ 1.000000000000000
+
- -
+
-
false
@@ -125,50 +126,47 @@
0
-
-
- 22
- 22
-
-
true
- override label bold
+
- -
-
-
- &Use plot default font
+
-
+
+
+ Qt::Horizontal
-
- true
+
+
+ 40
+ 20
+
-
+
- -
-
+
-
+
false
-
- override label color
-
- -
-
+
-
+
- points
+ &Use plot default font
+
+
+ true
- -
+
-
Qt::Vertical
@@ -176,7 +174,7 @@
20
- 129
+ 659
diff --git a/src/libkstapp/themedialog.cpp b/src/libkstapp/themedialog.cpp
index 1545a75..1fe242d 100644
--- a/src/libkstapp/themedialog.cpp
+++ b/src/libkstapp/themedialog.cpp
@@ -53,14 +53,16 @@ ThemeDialog::ThemeDialog(QWidget *parent) : QDialog(par=
ent) {
connect(_buttonBox, SIGNAL(clicked(QAbstractButton*)),
this, SLOT(buttonClicked(QAbstractButton*)));
=
- _bold->setFixedWidth(32);
- _bold->setFixedHeight(32);
+ int h =3D fontMetrics().lineSpacing();
+
+ _bold->setFixedWidth(h);
+ _bold->setFixedHeight(h);
_bold->setIcon(KstGetIcon("kst_bold"));
- _italic->setFixedWidth(32);
- _italic->setFixedHeight(32);
+ _italic->setFixedWidth(h);
+ _italic->setFixedHeight(h);
_italic->setIcon(KstGetIcon("kst_italic"));
- _labelColor->setFixedWidth(32);
- _labelColor->setFixedHeight(32);
+ _labelColor->setFixedWidth(h);
+ _labelColor->setFixedHeight(h);
=
_applyToExisting->setChecked(true);
_saveAsDefault->setChecked(true);