[aseprite] 42/250: Add mini_scrollbar_size dimension in skin.xml

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit dc6161a66abfbc5c72b61280adf8937a7869d9ff
Author: David Capello <davidcapello at gmail.com>
Date:   Wed Sep 16 11:10:30 2015 -0300

    Add mini_scrollbar_size dimension in skin.xml
---
 data/skins/default/skin.xml       | 1 +
 src/app/ui/editor/editor_view.cpp | 7 +++++--
 src/app/ui/editor/editor_view.h   | 3 ---
 src/app/ui/preview_editor.cpp     | 4 +++-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/data/skins/default/skin.xml b/data/skins/default/skin.xml
index 887efad..50a6e21 100644
--- a/data/skins/default/skin.xml
+++ b/data/skins/default/skin.xml
@@ -5,6 +5,7 @@
 
   <dimensions>
     <dim id="scrollbar_size" value="12" />
+    <dim id="mini_scrollbar_size" value="6" />
     <dim id="tabs_width" value="80" />
     <dim id="tabs_height" value="17" />
     <dim id="tabs_bottom_height" value="5" />
diff --git a/src/app/ui/editor/editor_view.cpp b/src/app/ui/editor/editor_view.cpp
index 4421cf1..2189259 100644
--- a/src/app/ui/editor/editor_view.cpp
+++ b/src/app/ui/editor/editor_view.cpp
@@ -133,8 +133,11 @@ void EditorView::setupScrollbars()
     hideScrollBars();
   }
   else {
-    getHorizontalBar()->setBarWidth(kEditorViewScrollbarWidth*guiscale());
-    getVerticalBar()->setBarWidth(kEditorViewScrollbarWidth*guiscale());
+    SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
+    int barsize = theme->dimensions.miniScrollbarSize();
+
+    getHorizontalBar()->setBarWidth(barsize);
+    getVerticalBar()->setBarWidth(barsize);
 
     setup_mini_look(getHorizontalBar());
     setup_mini_look(getVerticalBar());
diff --git a/src/app/ui/editor/editor_view.h b/src/app/ui/editor/editor_view.h
index cf09207..92396a9 100644
--- a/src/app/ui/editor/editor_view.h
+++ b/src/app/ui/editor/editor_view.h
@@ -15,9 +15,6 @@
 namespace app {
   class Editor;
 
-  // TODO hardcoded scroll bar width should be get from skin.xml file
-  const int kEditorViewScrollbarWidth = 6;
-
   class EditorView : public ui::View {
   public:
     enum Type { CurrentEditorMode, AlwaysSelected };
diff --git a/src/app/ui/preview_editor.cpp b/src/app/ui/preview_editor.cpp
index 3dd2f85..40b649c 100644
--- a/src/app/ui/preview_editor.cpp
+++ b/src/app/ui/preview_editor.cpp
@@ -211,10 +211,12 @@ bool PreviewEditorWindow::onProcessMessage(ui::Message* msg)
 
     case kOpenMessage:
       {
+        SkinTheme* theme = SkinTheme::instance();
+
         // Default bounds
         int width = ui::display_w()/4;
         int height = ui::display_h()/4;
-        int extra = 2*kEditorViewScrollbarWidth*guiscale();
+        int extra = 2*theme->dimensions.miniScrollbarSize();
         setBounds(
           gfx::Rect(
             ui::display_w() - width - ToolBar::instance()->getBounds().w - extra,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list