[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Can you change the size of a maximized window?
From:       "Granger, Michael C CIV" <michael.c.granger () navy ! mil>
Date:       2006-01-26 15:17:55
Message-ID: 6DFDB21FDA8C5E4BACEAD7FC3DB223311D0355 () naeanrfkez05 ! nadsusea ! nads ! navy ! mil
[Download RAW message or body]

--===============1901649369==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6228B.AEC66F4B"

This is a multi-part message in MIME format.


Hi, I'm trying to find out if I can change the default behavior of the =
maximize button for a KMainWindow.  I've googled and searched archives, =
but haven't found the solution.

I have a toolbar at the top of my desktop which I don't want to be =
covered when I maximize my application.  I would like the maximize =
button to make the application fill the rest of the screen, just not the =
toolbar.

I have tried to use QWidget::setMaximumHeight() and QWidget =
::setMaximumSize(), but if I use these commands, the maximize button =
just disappears from the system menu.

Currently, I am catching the resize and move events, determining if the =
window is covering the toolbar and, if so, repositioning/resizing the =
window so it doesn't.

This works, but is inelegant.  The problems with that solution are:
1)	The events occur after the maximize, so there's a screen flicker as =
the app maximizes, then gets resized and repositioned.
2)	The window isn't "maximized" anymore after I resize and reposition =
it, so I can't use the "restore" button to move the window back to it's =
old position.

I know this should be possible because the system taskbar has an option =
under "Hiding" that says "Allow other windows to cover the panel" and if =
I maximize when this option is checked, the app resizes and covers the =
taskbar.  If the option is not selected, the app will resize slightly =
smaller, so that it doesn't cover the taskbar.  I just have yet to =
figure out how this works.

I'm also not sure if this is something I have to do inside my app or if =
this is something that I have to do with KWin.

Thanks for the help.

Mike Granger


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6617.47">
<TITLE>Can you change the size of a maximized window?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">Hi, \
I&#8217;m trying to find out if I can change the default behavior of the maximize \
button for a K</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">M</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">ainWindow.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&nbsp; I&#8217;ve googled and searched archives, but \
haven</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">&#8217;t found the solution.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">I have a \
toolbar at the top of my desktop which I don&#8217;t want to be covered when I \
maximize my application.&nbsp; I would like the maximize button to</FONT></SPAN><SPAN \
LANG="en-us"> <FONT COLOR="#000000" SIZE=2 FACE="Arial">make the application fill the \
rest of the screen, just not the toolbar.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">I have \
tried</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 FACE="Arial">to \
use</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">QWidget::</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">setMaximumHeight</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" \
SIZE=2 FACE="Arial">()</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial"> and</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">Q</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">W</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">idget</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial"> ::setMaximumSize(), but if I use these commands, the maximize button \
just disappears from the system menu.</FONT></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">Currently, \
I am catching the resize</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" \
SIZE=2 FACE="Arial">and move events, determining if the window is covering the \
toolbar and</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">, if so,</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial"> repositioning</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" \
SIZE=2 FACE="Arial">/resizing</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" \
SIZE=2 FACE="Arial"> the window</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">so</FONT></SPAN><SPAN LANG="en-us"><FONT \
COLOR="#000000" SIZE=2 FACE="Arial"> it doesn</FONT></SPAN><SPAN LANG="en-us"><FONT \
COLOR="#000000" SIZE=2 FACE="Arial">&#8217;t</FONT></SPAN><SPAN LANG="en-us"><FONT \
COLOR="#000000" SIZE=2 FACE="Arial">.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">This \
works, but is inelegant.&nbsp;</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" \
SIZE=2 FACE="Arial">The problems with that solution are</FONT></SPAN><SPAN \
LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">:</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">T</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">he events occur after the</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">maximize, so there&#8217;s a screen flicker as \
the app maximizes, then gets resized and repositioned.</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial">2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">The window isn&#8217;t &#8220;maximized&#8221; \
anymore after</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">I resize and reposition it, so</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">I</FONT></SPAN><SPAN LANG="en-us"><FONT \
COLOR="#000000" SIZE=2 FACE="Arial"></FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">can&#8217;t use the &#8220;restore&#8221; button \
to move the window back to it&#8217;s old position.</FONT></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">I know \
this should be possible because the</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">system</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">taskbar has an option</FONT></SPAN><SPAN \
LANG="en-us"> <FONT COLOR="#000000" SIZE=2 FACE="Arial">under \
&#8220;Hiding&#8221;</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">that says &#8220;</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" \
SIZE=2 FACE="Arial">Allow other windows to cover the panel&#8221; and if I maximize \
when this option is checked, the</FONT></SPAN><SPAN LANG="en-us"> <FONT \
COLOR="#000000" SIZE=2 FACE="Arial">app</FONT></SPAN><SPAN LANG="en-us"><FONT \
COLOR="#000000" SIZE=2 FACE="Arial"> resizes and covers the taskbar.&nbsp; If the \
option is not selected, the</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" \
SIZE=2 FACE="Arial">app</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial"> will resize slightly smaller, so that it doesn&#8217;t cover the \
taskbar.&nbsp; I just have yet to figure out how this works.</FONT></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">I&#8217;m \
also not sure if this is something I have to do inside my app or if this is something \
that</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 \
FACE="Arial"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000000" SIZE=2 \
FACE="Arial">have to do with KWin.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">Thanks for \
the help.</FONT></SPAN></P>

<P ALIGN=LEFT><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial">Mike \
Granger</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

</BODY>
</HTML>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

--===============1901649369==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic