This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22797 - netbeans.windows.maxframe & netbeans.windows.small_main_window do not cooperate
Summary: netbeans.windows.maxframe & netbeans.windows.small_main_window do not cooperate
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: mslama
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2002-04-25 15:41 UTC by Jesse Glick
Modified: 2008-12-23 09:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Marek's proposed patch (2.05 KB, patch)
2002-04-25 15:43 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-04-25 15:41:41 UTC
With these two flags on (first is now on by
default), there is a problem with the status bar
in the Main Window. Without maxframe but with
small_main_window, it occupies all available space
in the main menu bar, which is otherwise wasted
space. With both, the status messages are
truncated when they get to where the maximized
desktop frame begins horizontally; i.e. the space
above the maximized Editor window is blank even
though status messages could fit there. The status
line ought to extend all the way over to the
window controls (minimize/unmax/close) for the max
desktop frame.

P4 even though a sort of regression, since
small_main_window is an experimental unsupported
feature.

Marek suggests:

---%<---
Problem was with preffered size assigned to status
line. It was too small. This patch sets all
available width in menu bar
to status line. I simply subtract width occupied
by menu items and buttons from total menu bar
width and assign all remaining
width to status line when switch is used.
---%<---

but I don't think that patch will work as is.
Consider turning on the CVS module and the
Versioning menu appears - you need to recalc the
status bar width.
Comment 1 Jesse Glick 2002-04-25 15:43:20 UTC
Created attachment 5560 [details]
Marek's proposed patch
Comment 2 mslama 2002-04-25 16:56:59 UTC
It is OK. StatusLine.getPrefferedSize() is called every time
revalidate of menu bar is performed not just at start. 

I checked what happens when you disable CVS => menu is refreshed =>
buttons disappear. I suspect that during refreshing menu removeAll()
is called on menu bar it causes missing buttons. But it is different
problem. I will file issue for it - it happens also without small
window switch. I think it  will require either to split menu bar and
added buttons or to make refreshing menu bar smarter - not to remove
all everything just menu items but not buttons because adding/removing
buttons is controled elsewhere. Is such solution acceptable?
Comment 3 Jesse Glick 2002-04-25 17:22:36 UTC
The trouble is that org.openide.awt.MenuBar calls removeAll() when it
refreshes. For workaround, see
org.netbeans.core.windows.MainWindow.StatusMenuBar.validate(). Should
be straightforward to hack that more generally to preserve all
non-JMenu's (or whatever it is that MenuBar is capable of adding).
Comment 4 mslama 2002-04-26 14:08:18 UTC
I must overwrite MenuBar.removeAll(). It is the same with/without
small window switch. In addition I must make sure that menu items are
added at correct position - inserted in the middle - issue #22807
Comment 5 mslama 2002-04-29 16:50:27 UTC
Fixed in main trunk.

Modified: org/netbeans/core/windows/StatusLine.java r.1.10

All available space is assigned to status line when it is put to menu
bar to avoid truncation of status line.
Comment 6 Marian Mirilovic 2002-04-30 08:28:46 UTC
verified in [nb_dev](20020430)
Comment 7 Quality Engineering 2003-07-01 16:50:45 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.