Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » MinMaxAddon and Buttons
MinMaxAddon and Buttons [message #1385900] Thu, 12 June 2014 08:17 Go to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hey guys,

I'm using the MinMaxAddon to show the minimize and maximize buttons in
my PartStacks. As I only want to enable the minimize feature, I made the
maximize button invisible by setting the CSS property
swt-maximize-visible to false.

This works fine when the application is started and the UI is rendered
the first time. But when I minimize a PartStack and restore it again, it
shows both buttons. When I now click the minimize button, the maximize
button is removed and the minimize button "wanders" a bit to the right
but no minimize action happens. If I instead click the maximize button,
the PartStack gets minimized again.

Is this a bug of did I miss something?

Another question I have is: what's the difference between the small
min/max buttons and the bigger ones (that appear when I hover over the
small ones) and is there any way to prevent the small ones from
displaying and only get the big ones?

Thanks for any hints on this
Marina
Re: MinMaxAddon and Buttons [message #1385919 is a reply to message #1385900] Thu, 12 June 2014 09:20 Go to previous messageGo to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Me again,

looking at the code from the MinMaxAddon, I think this is the method,
that is responsible for my problem:

private void setCTFButtons(CTabFolder ctf, MUIElement stateElement,
boolean hideButtons) {
if (hideButtons) {
ctf.setMinimizeVisible(false);
ctf.setMaximizeVisible(false);
} else {
if (stateElement.getTags().contains(MINIMIZED)) {
ctf.setMinimizeVisible(false);
ctf.setMaximizeVisible(true);
ctf.setMaximized(true);
} else if (stateElement.getTags().contains(MAXIMIZED)) {
ctf.setMinimizeVisible(true);
ctf.setMaximizeVisible(true);
ctf.setMaximized(true);
} else {
ctf.setMinimizeVisible(true);
ctf.setMaximizeVisible(true);
ctf.setMinimized(false);
ctf.setMaximized(false);
ctf.layout();
}
}
}

Especially the last block (that should be the restore part). There both
buttons are set to be visible. Is there any way to get access to the CSS
data and find out whether those buttons have been made invisible for
that CTF?

On 12.06.2014 10:17, Marina Knieling wrote:
> Hey guys,
>
> I'm using the MinMaxAddon to show the minimize and maximize buttons in
> my PartStacks. As I only want to enable the minimize feature, I made the
> maximize button invisible by setting the CSS property
> swt-maximize-visible to false.
>
> This works fine when the application is started and the UI is rendered
> the first time. But when I minimize a PartStack and restore it again, it
> shows both buttons. When I now click the minimize button, the maximize
> button is removed and the minimize button "wanders" a bit to the right
> but no minimize action happens. If I instead click the maximize button,
> the PartStack gets minimized again.
>
> Is this a bug of did I miss something?
>
> Another question I have is: what's the difference between the small
> min/max buttons and the bigger ones (that appear when I hover over the
> small ones) and is there any way to prevent the small ones from
> displaying and only get the big ones?
>
> Thanks for any hints on this
> Marina
Re: MinMaxAddon and Buttons [message #1386811 is a reply to message #1385919] Fri, 20 June 2014 17:13 Go to previous message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member

Yes, that particular code is need because of a flaw in SWT; if you actually setMinimized(true) on a CTabFolder then the client area of the tab becomes *zero* sized (i.e. the stack's contents won't show up). you could simply clone the current MinMaxAddon project and create your own (that's why it's implemented as an addon).
Previous Topic:Listen to MPart close events
Next Topic:LinkageError?
Goto Forum:
  


Current Time: Tue Apr 23 16:29:01 GMT 2024

Powered by FUDForum. Page generated in 0.02824 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top