This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: handle menu bar height in GtkFramePeer's setResizable


Hello,

I checked the following in as obvious.

Tom

2004-01-20  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* gnu/java/awt/peer/gtk/GtkFramePeer.java (setResizable):
	Override GtkWindowPeer's setResizable method to account for menu
	bar height when setting the frame's size.

Index: gnu/java/awt/peer/gtk/GtkFramePeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java,v
retrieving revision 1.9
diff -u -r1.9 GtkFramePeer.java
--- gnu/java/awt/peer/gtk/GtkFramePeer.java	19 Jan 2004 14:27:45
-0000	1.9
+++ gnu/java/awt/peer/gtk/GtkFramePeer.java	20 Jan 2004 20:56:10 -0000
@@ -79,6 +79,18 @@
     }
   }
 
+  public void setResizable (boolean resizable)
+  {
+    // Call setSize; otherwise when resizable is changed from true to
+    // false the frame will shrink to the dimensions it had before it
+    // was resizable.
+    setSize (awtComponent.getWidth() - insets.left - insets.right,
+             awtComponent.getHeight() - insets.top - insets.bottom
+             + menuBarHeight);
+    set ("allow_shrink", resizable);
+    set ("allow_grow", resizable);
+  }
+
   protected void postSizeAllocateEvent()
   {
     if (menuBar != null)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]