aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-04-14 00:25:14 +0200
committerJean-Baptiste Mardelle <[email protected]>2015-04-14 00:25:14 +0200
commita4607bab9627276603da6aef2dc69b0249e3285e (patch)
tree3f8b5f250d0c8beaa125813b6d69ec37354632be
parentac9696941c806f58cf8464b0426261cbfbaa5afb (diff)
Better size for bin icon on startup for high dpi
-rw-r--r--src/bin/bin.cpp5
-rw-r--r--src/kdenlivesettings.kcfg4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index 31b2156..d39eef5 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -259,6 +259,8 @@ Bin::Bin(QWidget* parent) :
m_slider->setMaximumWidth(100);
m_slider->setMinimumWidth(40);
m_slider->setRange(0, 10);
+ // TODO: fix view zoom on startup
+ //m_slider->setValue(KdenliveSettings::bin_zoom());
m_slider->setValue(4);
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotSetIconSize(int)));
QWidgetAction * widgetslider = new QWidgetAction(this);
@@ -505,7 +507,7 @@ void Bin::setDocument(KdenliveDoc* project)
m_clipCounter = 1;
m_folderCounter = 1;
m_doc = project;
- int iconHeight = style()->pixelMetric(QStyle::PM_ToolBarIconSize) * 2;
+ int iconHeight = QFontInfo(font()).pixelSize() * 3.5;
m_iconSize = QSize(iconHeight * m_doc->dar(), iconHeight);
m_itemModel->setIconSize(m_iconSize);
m_jobManager = new JobManager(this, project->fps());
@@ -882,6 +884,7 @@ void Bin::slotSetIconSize(int size)
if (!m_itemView) {
return;
}
+ KdenliveSettings::setBin_zoom(size);
QSize zoom = m_iconSize;
zoom = zoom * (size / 4.0);
m_itemView->setIconSize(zoom);
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index adef713..63f416f 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -12,6 +12,10 @@
<label>Bin view mode.</label>
<default>0</default>
</entry>
+ <entry name="bin_zoom" type="Int">
+ <label>Bin default zoom.</label>
+ <default>4</default>
+ </entry>
</group>
<group name="misc">