26 #define YUILogComponent "qt-ui"
27 #include <yui/YUILog.h>
28 #include <QResizeEvent>
31 #include <yui/YEvent.h>
33 #include "YQMainWinDock.h"
35 #define VERBOSE_RESIZE 1
52 YQUI::ui()->noBorder() ?
53 Qt::FramelessWindowHint :
57 setFocusPolicy( Qt::StrongFocus );
59 resize(
YQUI::ui()->defaultSize( YD_HORIZ ),
60 YQUI::ui()->defaultSize( YD_VERT ) );
62 yuiDebug() <<
"MainWinDock initial size: "
63 << size().width() <<
" x " << size().height()
79 resize( event->size() );
88 for ( YQWidgetStack::reverse_iterator it = _widgetStack.rbegin(); it != _widgetStack.rend(); it++ )
92 QRect rect = QRect( QPoint( 0, 0 ), size() );
97 yuiDebug() << dialog <<
" with " << wizard <<
" isSecondary: " << std::boolalpha << wizard->
isSecondary() << std::endl;
101 if ( QApplication::isLeftToRight() )
104 rect.setWidth( rect.width() );
107 if ( dialog->rect() != rect )
110 yuiDebug() <<
"Resizing child dialog " << std::hex << ( (
void *) dialog ) << std::dec
111 <<
" to " << rect.width() <<
" x " << rect.height()
114 dialog->setGeometry( rect );
125 if ( ! _widgetStack.empty() )
127 QWidget * dialog = _widgetStack.back();
137 YUI_CHECK_PTR( dialog );
146 yuiDebug() <<
"Adding dialog " << std::hex << (
void *) dialog << std::dec
150 _widgetStack.push_back( dialog );
160 if ( _widgetStack.empty() )
168 YQDialog * dialog = _widgetStack.back();
169 QWidget * widget = (QWidget *) dialog->widgetRep();
197 if ( ! _widgetStack.empty() )
199 QWidget * dialog = _widgetStack.back();
200 yuiDebug() <<
"Showing dialog " << std::hex << (
void *) dialog << std::dec << std::endl;
210 if ( _widgetStack.empty() )
214 dialog = _widgetStack.back();
216 if ( dialog == _widgetStack.back() )
221 _widgetStack.pop_back();
223 yuiDebug() <<
"Removing dialog " << std::hex << (
void *) dialog << std::dec
224 <<
" from mainWinDock"
229 YQMainWinDock::YQWidgetStack::iterator pos = findInStack( dialog );
231 if ( pos == _widgetStack.end() )
234 yuiWarning() <<
"Found dialog somewhere in the middle of the widget stack" << std::endl;
235 yuiDebug() <<
"Removing dialog " << std::hex << (
void *) dialog << std::dec
236 <<
" from mainWinDock"
239 _widgetStack.erase( pos );
242 if ( _widgetStack.empty() )
246 dialog = _widgetStack.back();
255 YQMainWinDock::YQWidgetStack::iterator
256 YQMainWinDock::findInStack(
YQDialog * dialog )
258 for ( YQMainWinDock::YQWidgetStack::iterator it = _widgetStack.begin();
259 it != _widgetStack.end();
266 return _widgetStack.end();
273 if ( _widgetStack.empty() )
276 return _widgetStack.back();
283 YDialog * topDialog = YDialog::topmostDialog(
false );
303 yuiMilestone() <<
"Caught window manager close event - returning with YCancelEvent" << std::endl;
319 if ( _sideBarWidth == width )
322 _sideBarWidth = width;
327 #include "YQMainWinDock.moc"