Author: rpmcruz
Date: Wed Dec 3 13:41:21 2008
New Revision: 53833
URL: http://svn.opensuse.org/viewcvs/yast?rev=53833&view=rev
Log:
* src/YGUI.cc: bug fix 442052: GTK doesn't seem to have a desktopSize()
call that doesn't include the panel and window frame in the display-size.
Assume less 80px in the display-size to compensate for that.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGUI.cc
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=53833&r1=53832&r2=53833&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Dec 3 13:41:21 2008
@@ -3,6 +3,10 @@
* src/ygtkrichtext.c: arabic fix: margin was being mirrored for
block tags like <li> and <blockquote>.
+ * src/YGUI.cc: bug fix 442052: GTK doesn't seem to have a desktopSize()
+ call that doesn't include the panel and window frame in the display-size.
+ Assume less 80px in the display-size to compensate for that.
+
2008-12-01 Ricardo Cruz
* src/YGPushButton.cc: bug fix 449740: use functionKey as a stock
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=53833&r1=53832&r2=53833&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Wed Dec 3 13:41:21 2008
@@ -21,7 +21,7 @@
be a YGDialog and is swap-able.
*/
-#define DEFAULT_WIDTH 600
+#define DEFAULT_WIDTH 650
#define DEFAULT_HEIGHT 600
class YGWindow;
@@ -424,9 +424,9 @@
bool resize = false;
if (isMainDialog()) {
if (window->allocation.width < width || window->allocation.height < height) {
+ resize = true;
width = MAX (width, window->allocation.width),
height = MAX (height, window->allocation.height);
- resize = true;
}
}
else
@@ -444,10 +444,8 @@
GtkWidget *window = m_window->getWidget();
width = MIN (width, YUI::app()->displayWidth());
height = MIN (height, YUI::app()->displayHeight());
- if (window->allocation.width < width || window->allocation.height < height) {
- width = MAX (width, window->allocation.width),
- height = MAX (height, window->allocation.height);
- }
+ width = MAX (width, window->allocation.width),
+ height = MAX (height, window->allocation.height);
gtk_window_resize (GTK_WINDOW (window), width, height);
}
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=53833&r1=53832&r2=53833&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Wed Dec 3 13:41:21 2008
@@ -143,13 +143,6 @@
#endif
}
-static inline GdkScreen *getScreen ()
-{ return gdk_display_get_default_screen (gdk_display_get_default()); }
-static int getDisplayWidth()
-{ return gdk_screen_get_width (getScreen()); }
-static int getDisplayHeight()
-{ return gdk_screen_get_height (getScreen()); }
-
static gboolean ycp_wakeup_fn (GIOChannel *source, GIOCondition condition,
gpointer data)
{
@@ -564,11 +557,14 @@
else return size * (25/480.0);
}
+static inline GdkScreen *getScreen ()
+{ return gdk_display_get_default_screen (gdk_display_get_default()); }
+// GTK doesn't seem to have some desktopWidth/Height like Qt, so we to report
+// a reduced display size to compensate for the panel, or the window frame
int YGApplication::displayWidth()
-{ return getDisplayWidth(); }
-
+{ return gdk_screen_get_width (getScreen()) - 80; }
int YGApplication::displayHeight()
-{ return getDisplayHeight(); }
+{ return gdk_screen_get_height (getScreen()) - 80; }
int YGApplication::displayDepth()
{ return gdk_visual_get_best_depth(); }
@@ -576,10 +572,10 @@
long YGApplication::displayColors()
{ return 1L << displayDepth(); /*from yast-qt*/ }
-// YCP uses defaultWidth/Height() to use their smaller YWizard impl, so we fool
-// them since we want to use a smaller default size than qt
-int YGApplication::defaultWidth() { return 800; }
-int YGApplication::defaultHeight() { return 600; }
+// YCP uses defaultWidth/Height() to use their smaller YWizard impl; we
+// want to use a smaller default size than qt though, so assume a bigger size
+int YGApplication::defaultWidth() { return MIN (displayWidth(), 1024); }
+int YGApplication::defaultHeight() { return MIN (displayHeight(), 768); }
YWidgetFactory *YGUI::createWidgetFactory()
{ return new YGWidgetFactory; }
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org