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

List:       kde-commits
Subject:    [krita] libs: Fix preset layout after tag change and hide the scrollbar in the preset strip
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2016-06-18 13:33:22
Message-ID: E1bEGNG-0003pZ-PQ () code ! kde ! org
[Download RAW message or body]

Git commit 9f83ec0a9b32ae9b2426cad247309970527780d6 by Sven Langkamp.
Committed on 18/06/2016 at 13:33.
Pushed by langkamp into branch 'master'.

Fix preset layout after tag change and hide the scrollbar in the preset strip

M  +3    -0    libs/ui/widgets/kis_preset_chooser.cpp
M  +0    -2    libs/ui/widgets/kis_preset_selector_strip.cpp
M  +1    -0    libs/widgets/KoResourceItemChooser.cpp
M  +1    -0    libs/widgets/KoResourceTaggingManager.cpp
M  +3    -0    libs/widgets/KoResourceTaggingManager.h

http://commits.kde.org/krita/9f83ec0a9b32ae9b2426cad247309970527780d6

diff --git a/libs/ui/widgets/kis_preset_chooser.cpp \
b/libs/ui/widgets/kis_preset_chooser.cpp index 254cf73..d3ab69b 100644
--- a/libs/ui/widgets/kis_preset_chooser.cpp
+++ b/libs/ui/widgets/kis_preset_chooser.cpp
@@ -37,6 +37,7 @@
 #include <KoResourceModel.h>
 #include <KoResourceServerAdapter.h>
 #include <KoResourceItemChooserSync.h>
+#include "KoResourceItemView.h"
 
 #include <brushengine/kis_paintop_settings.h>
 #include <brushengine/kis_paintop_preset.h>
@@ -242,6 +243,8 @@ void KisPresetChooser::updateViewSettings()
     } else if (m_mode == STRIP) {
         m_chooser->setSynced(false);
         m_chooser->setRowCount(1);
+        m_chooser->itemView()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        m_chooser->itemView()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
         // An offset of 7 keeps the cell exactly square, TODO: use constants, not \
hardcoded numbers  m_chooser->setColumnWidth(m_chooser->viewSize().height() - 7);
         m_delegate->setShowText(false);
diff --git a/libs/ui/widgets/kis_preset_selector_strip.cpp \
b/libs/ui/widgets/kis_preset_selector_strip.cpp index eb46793..01aa807 100644
--- a/libs/ui/widgets/kis_preset_selector_strip.cpp
+++ b/libs/ui/widgets/kis_preset_selector_strip.cpp
@@ -35,8 +35,6 @@ KisPresetSelectorStrip::KisPresetSelectorStrip(QWidget* parent)
     smallPresetChooser->showButtons(false);
     smallPresetChooser->setViewMode(KisPresetChooser::STRIP);
     m_resourceItemView = smallPresetChooser->itemChooser()->itemView();
-    m_resourceItemView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    m_resourceItemView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     
     /* This is an heuristic to fill smallPresetChooser with only the presets
      * for the paintop that comes selected by default: Pixel Brush. */
diff --git a/libs/widgets/KoResourceItemChooser.cpp \
b/libs/widgets/KoResourceItemChooser.cpp index a75be10..147900c 100644
--- a/libs/widgets/KoResourceItemChooser.cpp
+++ b/libs/widgets/KoResourceItemChooser.cpp
@@ -173,6 +173,7 @@ KoResourceItemChooser::KoResourceItemChooser(QSharedPointer<KoAbstractResourceSe
  d->viewModeButton->setVisible(false);
 
     d->tagManager = new KoResourceTaggingManager(d->model, this);
+    connect(d->tagManager, SIGNAL(updateView()), this, SLOT(updateView()));
 
     layout->addWidget(d->tagManager->tagChooserWidget(), 0, 0);
     layout->addWidget(d->viewModeButton, 0, 1);
diff --git a/libs/widgets/KoResourceTaggingManager.cpp \
b/libs/widgets/KoResourceTaggingManager.cpp index 9a86efa..b0a222c 100644
--- a/libs/widgets/KoResourceTaggingManager.cpp
+++ b/libs/widgets/KoResourceTaggingManager.cpp
@@ -295,6 +295,7 @@ void KoResourceTaggingManager::updateTaggedResourceView()
     d->model->setCurrentTag(d->currentTag);
     d->model->updateServer();
     d->originalResources = d->model->currentlyVisibleResources();
+    emit updateView();
 }
 
 void KoResourceTaggingManager::tagChooserIndexChanged(const QString& lineEditText)
diff --git a/libs/widgets/KoResourceTaggingManager.h \
b/libs/widgets/KoResourceTaggingManager.h index 8d1a8f3..8d1f626 100644
--- a/libs/widgets/KoResourceTaggingManager.h
+++ b/libs/widgets/KoResourceTaggingManager.h
@@ -59,6 +59,9 @@ public:
     KoTagFilterWidget* tagFilterWidget();
     KoTagChooserWidget* tagChooserWidget();
 
+Q_SIGNALS:
+    void updateView();
+    
 private Q_SLOTS:
 
     void undeleteTag(const QString& tagToUndelete);


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

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