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

List:       koffice
Subject:    Re: Karbon & Krita 2Beta5 don't fit screen
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2007-11-21 15:29:19
Message-ID: 200711211629.19765.boud () valdyas ! org
[Download RAW message or body]

On Wednesday 21 November 2007, Thomas Zander wrote:
> On Wednesday 21. November 2007 14:36:02 Boudewijn Rempt wrote:
> > What we really need is an easy way to make dockers startup tabbed by
> > default.
> 
> What is wrong with the method I pasted elsewhere in this thread?
> Really, if there are problems there I don't know them, so please do write
> about them here!

You are right, it is possible to start the dockers tabbed, although it's not
particularly easy. A tricky bit is that the order of docker creation determines
the order of the dockers in the window. So, in KisView2::createGUI, I first have
to remove the existing dock widgets from the layout, then create my dock widgets 
in the right order, then re-add the plugin dock widgets (although that doesn't
make them show up again), and place them in the tabs. And then call show() on
a docker in the first that I want to show by default -- because it's the last
added docker in the last tab that's shown otherwise. That call does make the dock \
widget flicker on startup if the user hid it previously because it's briefly shown \
before being hidden again. Anyway: this is what I do, maybe it's useful for other \
KOffice  application maintainers as an example:

    // Remove the plugin dock widgets
    QList<QDockWidget*> dockWidgets = shell()->dockWidgets();
    foreach( QDockWidget * dockWidget, dockWidgets ) {
        shell()->removeDockWidget( dockWidget );
    }

    KoToolBoxFactory toolBoxFactory( m_d->canvasController, "Tools" );
    createDockWidget( &toolBoxFactory );

    KoToolDockerFactory toolDockerFactory;
    createDockWidget( &toolDockerFactory );

    KisBirdEyeBoxFactory birdeyeFactory(this);
    m_d->birdEyeBox = qobject_cast<KisBirdEyeBox*>( createDockWidget( &birdeyeFactory \
) );

    KisPaletteDockerFactory paletteDockerFactory(this);
    createDockWidget( &paletteDockerFactory );
   
    KoColorDockerFactory colorDockerFactory;
    createDockWidget( &colorDockerFactory );

    KisLayerBoxFactory layerboxFactory;
    m_d->layerBox = qobject_cast<KisLayerBox*>( createDockWidget( &layerboxFactory ) \
);

    // Add the plugin dock widgets again
    foreach( QDockWidget * dockWidget, dockWidgets ) {
        shell()->addDockWidget( Qt::RightDockWidgetArea, dockWidget );

    }
    QDockWidget * toolBox = qobject_cast<QDockWidget*>( \
shell()->findChild<QDockWidget*>("KoToolOptionsDocker" ));  QDockWidget * colorDocker \
= qobject_cast<QDockWidget*>( shell()->findChild<QDockWidget*>("KoColorDocker"));  \
QDockWidget * paletteDocker = qobject_cast<QDockWidget*>( \
shell()->findChild<QDockWidget*>("KisPaletteDocker"));  QDockWidget * strokeDocker = \
qobject_cast<QDockWidget*>( shell()->findChild<QDockWidget*>("Stroke Properties"));

    if (m_d->birdEyeBox != 0 && toolBox != 0) {
        shell()->tabifyDockWidget(m_d->birdEyeBox, toolBox);
    }
    
    if (colorDocker != 0 && paletteDocker != 0 && strokeDocker != 0) {
        shell()->tabifyDockWidget(colorDocker, paletteDocker);
        shell()->tabifyDockWidget(paletteDocker, strokeDocker);
    }
    colorDocker->show();
-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
____________________________________
koffice mailing list
koffice@kde.org
To unsubscribe please visit:
https://mail.kde.org/mailman/listinfo/koffice


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

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