Mailinglist Archive: yast-commit (1086 mails)

< Previous Next >
[yast-commit] r51804 - in /trunk/gtk: ChangeLog src/YGDialog.cc src/YGDialog.h src/YGPackageSelector.cc src/YGUI.cc
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Thu, 02 Oct 2008 19:05:52 -0000
  • Message-id: <20081002190552.EB70EB451C@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Thu Oct 2 21:05:52 2008
New Revision: 51804

URL: http://svn.opensuse.org/viewcvs/yast?rev=51804&view=rev
Log:
* src/YGDialog.cc: for bug 428965, set instead a higher default
height. Already has big as qt: ycp progs should cope.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGDialog.h
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/YGUI.cc

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=51804&r1=51803&r2=51804&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Thu Oct 2 21:05:52 2008
@@ -12,6 +12,9 @@
* src/YGUtils.cc: bug fix 428193: set stock icon only if it exists.
* src/ygtkwizard.c: bug fix 428193: idem.

+ * src/YGDialog.cc: for bug 428965, set instead a higher default
+ height. Already has big as qt: ycp progs should cope.
+
2008-09-30 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

* src/ygtkbargraph.h/.c: replaced usage of deprecated GtkTooltips API

Modified: trunk/gtk/src/YGDialog.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=51804&r1=51803&r2=51804&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Thu Oct 2 21:05:52 2008
@@ -22,7 +22,7 @@
*/

#define DEFAULT_WIDTH 650
-#define DEFAULT_HEIGHT 550
+#define DEFAULT_HEIGHT 600

class YGWindow;
static YGWindow *main_window = 0;
@@ -410,23 +410,39 @@
GtkWidget *window = m_window->getWidget();
if (GTK_WIDGET_REALIZED (window)) {
gtk_widget_queue_resize (window);
+#if 0
bool resize = false;
if (isMainDialog()) {
width = MIN (0.95 * YUI::app()->displayWidth(), width);
height = MIN (0.95 * YUI::app()->displayWidth(), width);
if (window->allocation.width < width ||
window->allocation.height < height) {
- width = MAX (width, window->allocation.width),
- height = MAX (height,
window->allocation.height);
+ width = MAX (width-100,
window->allocation.width),
+ height = MAX (height-60,
window->allocation.height);
resize = true;
}
}
else
resize = true;
if (resize)
+#else
+ if (!isMainDialog())
+#endif
gtk_window_resize (GTK_WINDOW (window), width, height);
}
}

+void YGDialog::setMinSize (int width, int height)
+{
+ GtkWidget *window = m_window->getWidget();
+ width = MIN (0.95 * YUI::app()->displayWidth(), width);
+ height = MIN (0.95 * YUI::app()->displayWidth(), width);
+ if (window->allocation.width < width || window->allocation.height <
height) {
+ width = MAX (width, window->allocation.width),
+ height = MAX (height, window->allocation.height);
+ }
+ gtk_window_resize (GTK_WINDOW (window), width, height);
+}
+
void YGDialog::highlight (YWidget *ywidget)
{
struct inner {

Modified: trunk/gtk/src/YGDialog.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.h?rev=51804&r1=51803&r2=51804&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.h (original)
+++ trunk/gtk/src/YGDialog.h Thu Oct 2 21:05:52 2008
@@ -29,9 +29,8 @@
static GtkWindow *currentWindow();

virtual void setSize (int width, int height);
+ void setMinSize (int width, int height); // used internally by
YGPackageSelector.cc
virtual void setEnabled (bool enabled);
-// virtual int preferredWidth() { return 0; }
-// virtual int preferredHeight() { return 0; }

virtual void openInternal();
virtual void activate();

Modified: trunk/gtk/src/YGPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=51804&r1=51803&r2=51804&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Thu Oct 2 21:05:52 2008
@@ -2493,7 +2493,7 @@
YGWidget (this, parent, true, YGTK_TYPE_WIZARD, NULL)
{
setBorder (0);
- YGDialog::currentDialog()->setSize (650, 600); // enlarge
+ YGDialog::currentDialog()->setMinSize (650, 600); // enlarge

YGtkWizard *wizard = YGTK_WIZARD (getWidget());
ygtk_wizard_set_header_icon (wizard,

Modified: trunk/gtk/src/YGUI.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=51804&r1=51803&r2=51804&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Thu Oct 2 21:05:52 2008
@@ -566,11 +566,10 @@
long YGApplication::displayColors()
{ return 1L << displayDepth(); /*from yast-qt*/ }

-// YCP writers use getDefaultWidth/Height() to do space saving if needed,
-// so just tell me the displayWidth/Height(). If that size is decent, let's
-// us deal with it.
-int YGApplication::defaultWidth() { return getDisplayWidth(); }
-int YGApplication::defaultHeight() { return getDisplayHeight(); }
+// 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 1000; }
+int YGApplication::defaultHeight() { return 1000; }

YWidgetFactory *YGUI::createWidgetFactory()
{ return new YGWidgetFactory; }

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages