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

List:       kde-commits
Subject:    [krita/petrovic/live-brush-preview] libs/ui: simplified the UI to just be reset and zoom to one hund
From:       Scott Petrovic <null () kde ! org>
Date:       2017-10-01 1:04:44
Message-ID: E1dySgW-0001sC-W9 () code ! kde ! org
[Download RAW message or body]

Git commit c5fe9090b8d387408edd491b137a097093bf340e by Scott Petrovic.
Committed on 01/10/2017 at 01:04.
Pushed by scottpetrovic into branch 'petrovic/live-brush-preview'.

simplified the UI to just be reset and zoom to one hundred percent. changed to icons

M  +43   -7    libs/ui/forms/wdgpaintopsettings.ui
M  +4    -1    libs/ui/widgets/kis_paintop_presets_popup.cpp
M  +10   -15   libs/ui/widgets/kis_preset_live_preview_view.cpp
M  +1    -1    libs/ui/widgets/kis_preset_live_preview_view.h

https://commits.kde.org/krita/c5fe9090b8d387408edd491b137a097093bf340e

diff --git a/libs/ui/forms/wdgpaintopsettings.ui \
b/libs/ui/forms/wdgpaintopsettings.ui index 78431f85374..51058882c93 100644
--- a/libs/ui/forms/wdgpaintopsettings.ui
+++ b/libs/ui/forms/wdgpaintopsettings.ui
@@ -152,13 +152,13 @@
        <property name="minimumSize">
         <size>
          <width>300</width>
-         <height>50</height>
+         <height>80</height>
         </size>
        </property>
        <property name="maximumSize">
         <size>
-         <width>250</width>
-         <height>50</height>
+         <width>300</width>
+         <height>80</height>
         </size>
        </property>
        <property name="font">
@@ -167,10 +167,10 @@
         </font>
        </property>
        <property name="frameShape">
-        <enum>QFrame::Box</enum>
+        <enum>QFrame::StyledPanel</enum>
        </property>
        <property name="frameShadow">
-        <enum>QFrame::Plain</enum>
+        <enum>QFrame::Raised</enum>
        </property>
        <property name="midLineWidth">
         <number>0</number>
@@ -196,15 +196,51 @@
       <layout class="QVBoxLayout" name="verticalLayout_3">
        <item>
         <widget class="QPushButton" name="zoomOutGraphicsViewButton">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
          <property name="text">
-          <string>-</string>
+          <string/>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QPushButton" name="resetGraphicsViewButton">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
          <property name="text">
-          <string>reset</string>
+          <string/>
          </property>
         </widget>
        </item>
diff --git a/libs/ui/widgets/kis_paintop_presets_popup.cpp \
b/libs/ui/widgets/kis_paintop_presets_popup.cpp index e252e348e19..ba698163b9e 100644
--- a/libs/ui/widgets/kis_paintop_presets_popup.cpp
+++ b/libs/ui/widgets/kis_paintop_presets_popup.cpp
@@ -303,10 +303,13 @@ \
                KisPaintOpPresetsPopup::KisPaintOpPresetsPopup(KisCanvasResourceProvider \
                * resou
     // setup things like the scene construct images, layers, etc that is a one-time \
thing  m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setup();
 
+        m_d->uiWdgPaintOpPresetSettings.zoomOutGraphicsViewButton->setIcon(KisIconUtils::loadIcon("view-fullscreen"));
                
         connect(m_d->uiWdgPaintOpPresetSettings.zoomOutGraphicsViewButton, \
SIGNAL(clicked(bool)),  m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView,
-                 SLOT(slotZoomViewOut()));
+                 SLOT(slotZoomToOneHundredPercent()));
 
+
+        m_d->uiWdgPaintOpPresetSettings.resetGraphicsViewButton->setIcon(KisIconUtils::loadIcon("view-refresh"));
                
         connect(m_d->uiWdgPaintOpPresetSettings.resetGraphicsViewButton, \
SIGNAL(clicked(bool)),  m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView,
                  SLOT(slotResetViewZoom()));
diff --git a/libs/ui/widgets/kis_preset_live_preview_view.cpp \
b/libs/ui/widgets/kis_preset_live_preview_view.cpp index b13194aed56..51e4831587a \
                100644
--- a/libs/ui/widgets/kis_preset_live_preview_view.cpp
+++ b/libs/ui/widgets/kis_preset_live_preview_view.cpp
@@ -63,7 +63,7 @@ void KisPresetLivePreviewView::setup()
     // everything is captured for big brush strokes
     //TODO: we need to update these points according to the brush size. Larger \
                brushes need larger strokes
     m_curvePointPI1.setPos(QPointF(m_canvasCenterPoint.x() - (this->width()*0.4),
-                                   m_canvasCenterPoint.y()));
+                                   m_canvasCenterPoint.y() + (this->height()*0.4)));
     m_curvePointPI1.setPressure(0.0);
 
     m_curvePointPI2.setPos(QPointF(m_canvasCenterPoint.x() + (this->width()*0.4),
@@ -72,11 +72,7 @@ void KisPresetLivePreviewView::setup()
     m_curvePointPI2.setPressure(1.0);
 
 
-    scaleFactor = 1.0;
-    slotZoomViewOut();// zoomed out a bit by default for now until we get something \
                better
-    slotZoomViewOut();
-    slotZoomViewOut();
-    slotZoomViewOut();
+    zoomToBrushSize();
 
 }
 
@@ -194,27 +190,26 @@ void KisPresetLivePreviewView::paintStroke()
 
 void KisPresetLivePreviewView::slotResetViewZoom()
 {
-    scaleFactor = 1.0;
-    resetMatrix();
-    this->scale(scaleFactor, scaleFactor);
+    // go back to normal display scale and position
+    zoomToBrushSize();
 }
 
-void KisPresetLivePreviewView::slotZoomViewOut()
+void KisPresetLivePreviewView::slotZoomToOneHundredPercent()
 {
-    scaleFactor = scaleFactor * 0.9;
+    scaleFactor = 1.0;
+    resetMatrix();
     this->scale(scaleFactor, scaleFactor);
 }
 
 void KisPresetLivePreviewView::zoomToBrushSize() {
 
-    // m_currentBrushSize.
     // when the zooming will start and stop
-    float minBrushVal = 1.0;
-    float maxBrushVal = 250.0;
+    float minBrushVal = 15.0;
+    float maxBrushVal = 275.0;
 
     // range of scale values
     qreal minScale = 1.0;
-    qreal maxScale = 0.1;
+    qreal maxScale = 0.15;
 
 
     // find the slope of the line (slope-intercept form)
diff --git a/libs/ui/widgets/kis_preset_live_preview_view.h \
b/libs/ui/widgets/kis_preset_live_preview_view.h index 66349ef235c..96d1921a1af \
                100644
--- a/libs/ui/widgets/kis_preset_live_preview_view.h
+++ b/libs/ui/widgets/kis_preset_live_preview_view.h
@@ -52,7 +52,7 @@ public:
 
 public Q_SLOTS:
     void slotResetViewZoom();
-    void slotZoomViewOut();
+    void slotZoomToOneHundredPercent();
 
 
 


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

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