[aseprite] 09/250: Minor adjustments to ButtonSet style

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:03 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 7fb7b85b13b293cf0eea6bb95fc41b5e551e273e
Author: David Capello <davidcapello at gmail.com>
Date:   Fri Aug 28 15:48:19 2015 -0300

    Minor adjustments to ButtonSet style
---
 src/app/ui/button_set.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/app/ui/button_set.cpp b/src/app/ui/button_set.cpp
index d47d0f8..6949af5 100644
--- a/src/app/ui/button_set.cpp
+++ b/src/app/ui/button_set.cpp
@@ -78,7 +78,11 @@ void ButtonSet::Item::onPaint(ui::PaintEvent& ev)
     CENTER | (hasText() ? BOTTOM: MIDDLE),
     iconSize.w, iconSize.h);
 
-  if (m_icon) {
+  Grid::Info info = buttonSet()->getChildInfo(this);
+  bool isLastCol = (info.col+info.hspan >= info.grid_cols);
+  bool isLastRow = (info.row+info.vspan >= info.grid_rows);
+
+  if (m_icon || isLastRow) {
     textRc.y -= 1*guiscale();
     iconRc.y -= 1*guiscale();
   }
@@ -106,9 +110,10 @@ void ButtonSet::Item::onPaint(ui::PaintEvent& ev)
     bg = theme->colors.buttonNormalFace();
   }
 
-  Grid::Info info = buttonSet()->getChildInfo(this);
-  if (info.col+info.hspan < info.grid_cols) rc.w += 1*guiscale();
-  if (info.row+info.vspan < info.grid_rows) {
+  if (!isLastCol)
+    rc.w += 1*guiscale();
+
+  if (!isLastRow) {
     if (nw == theme->parts.toolbuttonHotFocused())
       rc.h += 2*guiscale();
     else
@@ -206,8 +211,8 @@ void ButtonSet::Item::onPreferredSize(ui::PreferredSizeEvent& ev)
   gfx::Size iconSize;
   if (m_icon) {
     iconSize = m_icon->getSize();
-    iconSize.w = MAX(iconSize.w+4*guiscale(), 16*guiscale());
-    iconSize.h = MAX(iconSize.h+4*guiscale(), 16*guiscale());
+    iconSize.w = MAX(iconSize.w, 16*guiscale());
+    iconSize.h = MAX(iconSize.h, 16*guiscale());
   }
 
   gfx::Rect boxRc;

-- 
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