[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/plasmate
From: Sebastian Kügler <sebas () kde ! org>
Date: 2011-03-14 23:53:46
Message-ID: 20110314235346.DFC56AC8CD () svn ! kde ! org
[Download RAW message or body]
SVN commit 1224928 by sebas:
hide toolbar on startpage, improve previewer sizing
M +5 -0 mainwindow.cpp
M +7 -5 previewer/plasmoid/plasmoidview.cpp
U previewer/previewer.h
--- trunk/playground/base/plasma/plasmate/mainwindow.cpp #1224927:1224928
@@ -36,6 +36,7 @@
#include <KTextEditor/View>
#include <KTextEditor/Editor>
#include <KTextEditor/CommandInterface>
+#include <KToolBar>
#include <KStandardAction>
#include <KUrl>
#include <KListWidget>
@@ -105,6 +106,7 @@
setXMLFile("plasmateui.rc");
setupActions();
createMenus();
+ toolBar()->hide();
m_startPage = new StartPage(this);
connect(m_startPage, SIGNAL(projectSelected(QString, QString)),
this, SLOT(loadProject(QString, QString)));
@@ -322,8 +324,10 @@
void MainWindow::saveAndRefresh()
{
saveEditorData();
+ if (m_previewerWidget) {
m_previewerWidget->refreshPreview();
}
+}
void MainWindow::editorDestructiveRefresh()
{
@@ -502,6 +506,7 @@
m_currentProjectType = type;
kDebug() << "Loading project named" << name << "...";
delete m_model;
+ toolBar()->show();
// Saving NewProject preferences
KConfigGroup preferences = KGlobal::config()->group("NewProjectDefaultPreferences");
--- trunk/playground/base/plasma/plasmate/previewer/plasmoid/plasmoidview.cpp #1224927:1224928
@@ -34,6 +34,7 @@
m_containment(0),
m_applet(0)
{
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setScene(&m_corona);
connect(&m_corona, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(sceneRectChanged(QRectF)));
setAlignment(Qt::AlignCenter);
@@ -45,6 +46,7 @@
m_containment = m_corona.addContainment("studiopreviewer");
m_containment->setFormFactor(Plasma::Planar);
m_containment->setLocation(Plasma::Floating);
+ m_containment->setAspectRatioMode(Plasma::IgnoreAspectRatio);
connect(m_containment, SIGNAL(appletRemoved(Plasma::Applet*)), this, SLOT(appletRemoved()));
// we do a two-way connect here to allow the previewer containment
@@ -90,7 +92,6 @@
void PlasmoidView::sceneRectChanged(const QRectF &rect)
{
Q_UNUSED(rect);
-
if (m_containment) {
setSceneRect(m_containment->geometry());
}
@@ -102,13 +103,14 @@
// if we do not have any applet being shown
// there is no need to do all this stuff
- if (!m_applet || m_applet->aspectRatioMode() != Plasma::KeepAspectRatio) {
+ //if (!m_applet || m_applet->aspectRatioMode() != Plasma::KeepAspectRatio) {
+ if (m_applet) {
+ m_applet->setMaximumWidth(size().width());
m_containment->resize(size());
return;
}
- QSize newSize = m_containment->size().toSize();
- newSize.scale(size(), Qt::KeepAspectRatio);
- m_containment->resize(newSize);
+ m_containment->resize(event->size());
centerOn(m_containment);
+ return;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic