[Scummvm-cvs-logs] scummvm master -> 3359abbe5fa9486ce45e7183b93a2c010f5457df

sev- sev at scummvm.org
Tue Jul 12 22:42:20 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
64a79fd1ab GUI: Fix TabWidget height issues
3359abbe5f Merge pull request #784 from Tkachov/tabwidget-height-fix


Commit: 64a79fd1ab4270ed50ef62cf0a795c842eb4d72a
    https://github.com/scummvm/scummvm/commit/64a79fd1ab4270ed50ef62cf0a795c842eb4d72a
Author: Alexander Tkachev (alexander at tkachov.ru)
Date: 2016-07-12T22:37:57+06:00

Commit Message:
GUI: Fix TabWidget height issues

Changes theme stx files to specify TabWidget's type. That fixes wrong TabWidget height.

Changes TabWidget's getHeight() to return not only "children" height, but also tabs height. That fixes wrong clipping area.

Changes Widget's findWidget to use getHeight(). That fixes bug when widgets in the bottom of TabWidget were not reacting to the mouse events.

Changed paths:
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/widget.cpp
    gui/widgets/tab.cpp
    gui/widgets/tab.h



diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 43fcea1..561f2a5 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 65724d9..5172326 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -222,7 +222,7 @@
 
 	<dialog name = 'GlobalOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '16, 16, 16, 16'>
 				<space/>
 				<widget name = 'Cancel'
@@ -551,7 +551,7 @@
 
 	<dialog name = 'GameOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '16'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '16, 16, 16, 4'>
 				<space/>
 				<widget name = 'Cancel'
@@ -850,7 +850,7 @@
 
 	<dialog name = 'FluidSynthSettings' overlays = 'GlobalOptions' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '16, 16, 16, 16'>
 				<space/>
 				<widget name = 'ResetSettings'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f73f6e8..0013b91 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -97,7 +97,7 @@
 				padding = '0, 0, 2, 0'
 		/>
 		<widget name = 'TabWidget.Body'
-				padding = '0, 0, 0, -8'
+				padding = '0, 0, 0, 0'
 		/>
 		<widget name = 'TabWidget.NavButton'
 				size = '32, 18'
@@ -219,7 +219,7 @@
 
 	<dialog name = 'GlobalOptions' overlays = 'screen' inset = '16' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '8, 8, 8, 8'>
 				<space/>
 				<widget name = 'Cancel'
@@ -556,7 +556,7 @@
 
 	<dialog name = 'GameOptions' overlays = 'screen' inset = '16' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '16'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '8, 8, 8, 8'>
 				<space/>
 				<widget name = 'Cancel'
@@ -863,7 +863,7 @@
 
 	<dialog name = 'FluidSynthSettings' overlays = 'GlobalOptions' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '8, 8, 8, 8'>
 				<space/>
 				<widget name = 'ResetSettings'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index d7246fa..d80c481 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 56a54f8..026fa7b 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -565,7 +565,7 @@
 
 	<dialog name = 'GameOptions' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0' spacing = '16'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '16, 16, 16, 4'>
 				<space/>
 				<widget name = 'Cancel'
@@ -864,7 +864,7 @@
 
 	<dialog name = 'FluidSynthSettings' overlays = 'GlobalOptions' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '16, 16, 16, 16'>
 				<space/>
 				<widget name = 'ResetSettings'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index a3f06bd..169e61a 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -217,7 +217,7 @@
 
 	<dialog name = 'GlobalOptions' overlays = 'screen' inset = '16' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '8, 8, 8, 8'>
 				<space/>
 				<widget name = 'Cancel'
@@ -861,7 +861,7 @@
 
 	<dialog name = 'FluidSynthSettings' overlays = 'GlobalOptions' shading = 'dim'>
 		<layout type = 'vertical' padding = '0, 0, 0, 0'>
-			<widget name = 'TabWidget'/>
+			<widget name = 'TabWidget' type = 'TabWidget'/>
 			<layout type = 'horizontal' padding = '8, 8, 8, 8'>
 				<space/>
 				<widget name = 'ResetSettings'
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 32ca022..f2a29c3 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -156,7 +156,7 @@ void Widget::draw() {
 Widget *Widget::findWidgetInChain(Widget *w, int x, int y) {
 	while (w) {
 		// Stop as soon as we find a widget that contains the point (x,y)
-		if (x >= w->_x && x < w->_x + w->_w && y >= w->_y && y < w->_y + w->_h)
+		if (x >= w->_x && x < w->_x + w->_w && y >= w->_y && y < w->_y + w->getHeight())
 			break;
 		w = w->_next;
 	}
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 784e438..15e6a9d 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -85,6 +85,14 @@ int16 TabWidget::getChildY() const {
 	return getAbsY() + _tabHeight;
 }
 
+uint16 TabWidget::getHeight() const {
+	// NOTE: if you change that, make sure to do the same
+	// changes in the ThemeLayoutTabWidget (gui/ThemeLayout.cpp)
+	// NOTE: this height is used for clipping, so it *includes*
+	// tabs, because it starts from getAbsY(), not getChildY()
+	return _h + _tabHeight;
+}
+
 int TabWidget::addTab(const String &title) {
 	// Add a new tab page
 	Tab newTab;
diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h
index 148f164..17b8598 100644
--- a/gui/widgets/tab.h
+++ b/gui/widgets/tab.h
@@ -110,6 +110,7 @@ protected:
 	// We overload getChildY to make sure child widgets are positioned correctly.
 	// Essentially this compensates for the space taken up by the tab title header.
 	virtual int16	getChildY() const;
+	virtual uint16	getHeight() const;
 
 	virtual void drawWidget();
 


Commit: 3359abbe5fa9486ce45e7183b93a2c010f5457df
    https://github.com/scummvm/scummvm/commit/3359abbe5fa9486ce45e7183b93a2c010f5457df
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-12T22:42:18+02:00

Commit Message:
Merge pull request #784 from Tkachov/tabwidget-height-fix

GUI: Fix TabWidget height issues

Changed paths:
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/widget.cpp
    gui/widgets/tab.cpp
    gui/widgets/tab.h









More information about the Scummvm-git-logs mailing list