avoid white spaces with astyle

v0.6
audoban 8 years ago
parent 9450a884c3
commit 756f4fdbe3

@ -31,12 +31,10 @@ namespace Latte {
AbstractWindowInterface::AbstractWindowInterface(QQuickWindow *const view, QObject *parent)
: QObject(parent), m_view(view)
{
}
AbstractWindowInterface::~AbstractWindowInterface()
{
}
AbstractWindowInterface *AbstractWindowInterface::getInstance(QQuickWindow *const view, QObject *parent)

@ -42,12 +42,9 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, DockView *dockV
m_dockView(dockView)
{
connections << connect(dockView, &QObject::destroyed, this, &QObject::deleteLater);
m_screenSyncTimer.setSingleShot(true);
m_screenSyncTimer.setInterval(100);
connections << connect(dockView, SIGNAL(screenChanged(QScreen *)), &m_screenSyncTimer, SLOT(start()));
connections << connect(&m_screenSyncTimer, &QTimer::timeout, this, [this]() {
setScreen(m_dockView->screen());
KWindowSystem::setType(winId(), NET::Dock);
@ -55,12 +52,10 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, DockView *dockV
syncGeometry();
syncSlideEffect();
});
KWindowSystem::setType(winId(), NET::Dock);
KWindowSystem::setState(winId(), NET::KeepAbove);
setFlags(wFlags());
KWindowSystem::forceActiveWindow(winId());
connections << connect(dockView->visibility(), &VisibilityManager::modeChanged, this, &DockConfigView::syncGeometry);
connections << connect(containment, &Plasma::Containment::immutabilityChanged, this, &DockConfigView::immutabilityChanged);
connections << connect(containment, &Plasma::Containment::locationChanged, [&]() {
@ -111,11 +106,9 @@ void DockConfigView::syncGeometry()
if (location == Plasma::Types::TopEdge) {
setPosition(sGeometry.center().x() - size.width() / 2
, m_dockView->currentThickness());
} else if (location == Plasma::Types::BottomEdge) {
setPosition(sGeometry.center().x() - size.width() / 2
, sGeometry.height() - m_dockView->currentThickness() - size.height());
}
}
break;
@ -129,11 +122,9 @@ void DockConfigView::syncGeometry()
if (location == Plasma::Types::LeftEdge) {
setPosition(m_dockView->currentThickness()
, sGeometry.center().y() - size.height() / 2);
} else if (location == Plasma::Types::RightEdge) {
setPosition(sGeometry.width() - m_dockView->currentThickness() - size.width()
, sGeometry.center().y() - size.height() / 2);
}
}
break;
@ -179,13 +170,11 @@ void DockConfigView::syncSlideEffect()
void DockConfigView::showEvent(QShowEvent *ev)
{
QQuickWindow::showEvent(ev);
KWindowSystem::setType(winId(), NET::Dock);
setFlags(wFlags());
KWindowSystem::setState(winId(), NET::KeepAbove | NET::SkipPager | NET::SkipTaskbar);
KWindowSystem::forceActiveWindow(winId());
KWindowEffects::enableBlurBehind(winId(), true);
syncGeometry();
syncSlideEffect();
@ -193,7 +182,6 @@ void DockConfigView::showEvent(QShowEvent *ev)
m_containment->setUserConfiguring(true);
m_screenSyncTimer.start();
QTimer::singleShot(400, this, &DockConfigView::syncGeometry);
}

@ -56,7 +56,6 @@ DockCorona::DockCorona(QObject *parent)
setKPackage(package);
qmlRegisterTypes();
connect(this, &Corona::containmentAdded, this, &DockCorona::addDock);
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
}
@ -72,10 +71,8 @@ DockCorona::~DockCorona()
qDeleteAll(m_waitingDockViews);
m_dockViews.clear();
m_waitingDockViews.clear();
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
delete m_activityConsumer;
qDebug() << "deleted" << this;
}
@ -125,7 +122,6 @@ QRect DockCorona::availableScreenRect(int id) const
int DockCorona::primaryScreenId() const
{
const auto screens = qGuiApp->screens();
int id = -1;
for (int i = 0; i < screens.size(); ++i) {
@ -156,7 +152,6 @@ int DockCorona::docksCount(int screen) const
}
qDebug() << docks << "docks on screen:" << screen;
return docks;
}
@ -170,7 +165,6 @@ QList<Plasma::Types::Location> DockCorona::freeEdges(int screen) const
using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge};
//when screen=-1 is passed then the primaryScreenid is used
int fixedScreen = (screen == -1) ? primaryScreenId() : screen;
@ -215,17 +209,13 @@ void DockCorona::addDock(Plasma::Containment *containment)
}
qDebug() << "Adding dock for container...";
auto dockView = new DockView(this);
dockView->init();
dockView->setContainment(containment);
connect(containment, &QObject::destroyed, this, &DockCorona::dockContainmentDestroyed);
connect(containment, &Plasma::Applet::destroyedChanged, this, &DockCorona::destroyedChanged);
dockView->show();
m_dockViews[containment] = dockView;
emit docksCountChanged();
}
@ -262,10 +252,8 @@ void DockCorona::loadDefaultLayout()
qDebug() << "loading default layout";
//! Settting mutable for create a containment
setImmutability(Plasma::Types::Mutable);
QVariantList args;
auto defaultContainment = createContainmentDelayed("org.kde.latte.containment", args);
defaultContainment->setContainmentType(Plasma::Types::PanelContainment);
defaultContainment->init();
@ -276,7 +264,6 @@ void DockCorona::loadDefaultLayout()
auto config = defaultContainment->config();
defaultContainment->restore(config);
QList<Plasma::Types::Location> edges = freeEdges(defaultContainment->screen());
if (edges.count() > 0) {
@ -291,9 +278,7 @@ void DockCorona::loadDefaultLayout()
defaultContainment->flushPendingConstraintsEvents();
emit containmentAdded(defaultContainment);
emit containmentCreated(defaultContainment);
addDock(defaultContainment);
defaultContainment->createApplet(QStringLiteral("org.kde.latte.plasmoid"));
defaultContainment->createApplet(QStringLiteral("org.kde.plasma.analogclock"));
}

@ -51,7 +51,6 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
setVisible(false);
setTitle(corona->kPackage().metadata().name());
setIcon(QIcon::fromTheme(corona->kPackage().metadata().iconName()));
setResizeMode(QuickViewSharedEngine::SizeRootObjectToView);
setClearBeforeRendering(true);
@ -71,22 +70,17 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
QAction *lockWidgetsAction = containment()->actions()->action("lock widgets");
containment()->actions()->removeAction(lockWidgetsAction);
QAction *removeAction = containment()->actions()->action("remove");
removeAction->setVisible(false);
//containment()->actions()->removeAction(removeAction);
//FIX: hide and not delete in order to disable a nasty behavior from
//ContainmentInterface. If only one action exists for containment the
//this action is triggered directly
QAction *addWidgetsAction = containment()->actions()->action("add widgets");
addWidgetsAction->setVisible(false);
//containment()->actions()->removeAction(addWidgetsAction);
connect(containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus)));
}, Qt::DirectConnection);
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (dockCorona) {
@ -121,14 +115,10 @@ void DockView::init()
updateFormFactor();
syncGeometry();
});
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
rootContext()->setContextProperty(QStringLiteral("dock"), this);
setSource(corona()->kPackage().filePath("lattedockui"));
setVisible(true);
syncGeometry();
qDebug() << "SOURCE:" << source();
}
@ -256,7 +246,6 @@ void DockView::setLocalDockGeometry(const QRect &geometry)
}
m_localDockGeometry = geometry;
emit localDockGeometryChanged();
}
@ -276,7 +265,6 @@ void DockView::updatePosition()
const QRect screenGeometry = screen()->geometry();
QPoint position;
position = {0, 0};
switch (location()) {
@ -284,22 +272,18 @@ void DockView::updatePosition()
position = {screenGeometry.x(), screenGeometry.y()};
m_maxLength = screenGeometry.width();
break;
case Plasma::Types::BottomEdge:
position = {screenGeometry.x(), screenGeometry.y() + screenGeometry.height() - height()};
m_maxLength = screenGeometry.width();
break;
case Plasma::Types::RightEdge:
position = {screenGeometry.x() + screenGeometry.width() - width(), screenGeometry.y()};
m_maxLength = screenGeometry.height();
break;
case Plasma::Types::LeftEdge:
position = {screenGeometry.x(), screenGeometry.y()};
m_maxLength = screenGeometry.height();
break;
default:
qWarning() << "wrong location, couldn't update the panel position"
<< location();
@ -314,7 +298,6 @@ inline void DockView::syncGeometry()
resizeWindow();
updatePosition();
updateAbsDockGeometry();
qDebug() << "dock geometry:" << qRectToStr(geometry());
}
@ -409,7 +392,6 @@ void DockView::setMaskArea(QRect area)
m_maskArea = area;
setMask(m_maskArea);
//qDebug() << "dock mask set:" << m_maskArea;
emit maskAreaChanged();
}
@ -448,14 +430,12 @@ VisibilityManager *DockView::visibility()
bool DockView::event(QEvent *e)
{
emit eventTriggered(e);
return ContainmentView::event(e);
}
QList<int> DockView::freeEdges() const
{
const auto edges = corona()->freeEdges(containment()->screen());
QList<int> edgesInt;
foreach (Plasma::Types::Location edge, edges) {
@ -481,15 +461,12 @@ void DockView::closeApplication()
QVariantList DockView::containmentActions()
{
QVariantList actions;
/*if (containment()->corona()->immutability() != Plasma::Types::Mutable) {
return actions;
}*/
//FIXME: the trigger string it should be better to be supported this way
//const QString trigger = Plasma::ContainmentActions::eventToString(event);
const QString trigger = "RightButton;NoModifier";
Plasma::ContainmentActions *plugin = containment()->containmentActions().value(trigger);
if (!plugin) {
@ -498,7 +475,6 @@ QVariantList DockView::containmentActions()
if (plugin->containment() != containment()) {
plugin->setContainment(containment());
// now configure it
KConfigGroup cfg(containment()->corona()->config(), "ActionPlugins");
cfg = KConfigGroup(&cfg, QString::number(containment()->containmentType()));
@ -551,7 +527,6 @@ void DockView::mouseReleaseEvent(QMouseEvent *event)
}
PlasmaQuick::ContainmentView::mouseReleaseEvent(event);
event->setAccepted(containment()->containmentActions().contains(Plasma::ContainmentActions::eventToString(event)));
}
@ -583,7 +558,6 @@ void DockView::mousePressEvent(QMouseEvent *event)
}
//qDebug() << "2...";
//the plugin can be a single action or a context menu
//Don't have an action list? execute as single action
//and set the event position as action data
@ -594,9 +568,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
event->accept();
return;
}*/
//qDebug() << "3...";
//FIXME: very inefficient appletAt() implementation
Plasma::Applet *applet = 0;
@ -614,12 +586,9 @@ void DockView::mousePressEvent(QMouseEvent *event)
if ((meta.pluginId() != "org.kde.plasma.systemtray") &&
(meta.pluginId() != "org.kde.latte.plasmoid")) {
//qDebug() << "4...";
QMenu *desktopMenu = new QMenu;
desktopMenu->setAttribute(Qt::WA_DeleteOnClose);
m_contextMenu = desktopMenu;
if (this->mouseGrabberItem()) {
@ -647,12 +616,10 @@ void DockView::mousePressEvent(QMouseEvent *event)
}
//qDebug() << "6...";
//this is a workaround where Qt now creates the menu widget
//in .exec before oxygen can polish it and set the following attribute
desktopMenu->setAttribute(Qt::WA_TranslucentBackground);
//end workaround
QPoint pos = event->globalPos();
if (applet) {
@ -660,9 +627,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
if (screen()) {
const QRect scr = screen()->geometry();
int smallStep = 3;
int x = event->globalPos().x() + smallStep;
int y = event->globalPos().y() + smallStep;
@ -691,9 +656,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
connect(desktopMenu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide()));
m_visibility->setBlockHiding(true);
desktopMenu->popup(pos);
event->setAccepted(true);
return;
}
}
@ -806,7 +769,6 @@ void DockView::addContainmentActions(QMenu *desktopMenu, QEvent *event)
if (plugin->containment() != containment()) {
plugin->setContainment(containment());
// now configure it
KConfigGroup cfg(containment()->corona()->config(), "ActionPlugins");
cfg = KConfigGroup(&cfg, QString::number(containment()->containmentType()));
@ -830,7 +792,6 @@ void DockView::addContainmentActions(QMenu *desktopMenu, QEvent *event)
return;
}
//!END overriding context menus behavior
}

@ -44,15 +44,12 @@ static const char version[] = "0.1";
int main(int argc, char **argv)
{
QQuickWindow::setDefaultAlphaBuffer(true);
QApplication app(argc, argv);
app.setApplicationVersion(version);
app.setOrganizationDomain(QStringLiteral("latte-dock"));
KLocalizedString::setApplicationDomain("latte-dock");
app.setApplicationName(QStringLiteral("Latte Dock"));
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("latte-dock")));
//! set pattern for debug messages
//! [%{type}] [%{function}:%{line}] - %{message} [%{backtrace}]
qSetMessagePattern(QStringLiteral(
@ -63,9 +60,7 @@ int main(int argc, char **argv)
CICYAN " - " CNORMAL "%{message}"
CIRED "%{if-fatal}\n%{backtrace depth=8 separator=\"\n\"}%{endif}"
"%{if-critical}\n%{backtrace depth=8 separator=\"\n\"}%{endif}" CNORMAL));
// qputenv("QT_QUICK_CONTROLS_1_STYLE", "Desktop");
Latte::DockCorona corona;
return app.exec();
}

@ -40,10 +40,8 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
timerCheckWindows.setInterval(350);
timerCheckWindows.setSingleShot(true);
timerShow.setSingleShot(true);
timerHide.setSingleShot(true);
connect(&timerCheckWindows, &QTimer::timeout, this, &VisibilityManagerPrivate::checkAllWindows);
connect(&timerShow, &QTimer::timeout, this, [this]() {
if (isHidden) {
@ -57,7 +55,6 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
emit this->q->mustBeHide();
}
});
wm->setDockDefaultFlags();
}
@ -83,7 +80,6 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
timerShow.stop();
timerHide.stop();
timerCheckWindows.stop();
this->mode = mode;
switch (this->mode) {
@ -96,13 +92,11 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
if (view->containment()->isUserConfiguring())
wm->removeDockStruts();
});
connections[1] = connect(view->containment(), &Plasma::Containment::userConfiguringChanged
, this, [&](bool configuring) {
if (!configuring)
wm->setDockStruts(dockRect, view->containment()->location());
});
raiseDock(true);
}
break;
@ -121,7 +115,6 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
, this, [&](int) {
dodgeActive(wm->activeWindow());
});
dodgeActive(wm->activeWindow());
}
break;
@ -135,7 +128,6 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
, this, [&](int) {
dodgeMaximized(wm->activeWindow());
});
dodgeMaximized(wm->activeWindow());
}
break;
@ -147,7 +139,6 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
connections[0] = connect(wm.get(), &AbstractWindowInterface::windowChanged
, this, &VisibilityManagerPrivate::dodgeWindows);
connections[1] = connect(wm.get(), &AbstractWindowInterface::windowRemoved
, this, [&](WId wid) {
windows.erase(wid);
@ -162,13 +153,11 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
, this, [&](int) {
timerCheckWindows.start();
});
timerCheckWindows.start();
}
}
saveConfig();
emit q->modeChanged();
}
@ -192,7 +181,6 @@ void VisibilityManagerPrivate::setBlockHiding(bool blockHiding)
return;
this->blockHiding = blockHiding;
qDebug() << "blockHiding:" << blockHiding;
if (this->blockHiding) {
@ -200,7 +188,6 @@ void VisibilityManagerPrivate::setBlockHiding(bool blockHiding)
if (isHidden) {
isHidden = false;
emit q->isHiddenChanged();
emit q->mustBeShown();
}
@ -340,7 +327,6 @@ void VisibilityManagerPrivate::checkAllWindows()
if (std::get<1>(winfo).isFullscreen()) {
raise = false;
break;
} else if (intersects(std::get<1>(winfo))) {
raise = false;
break;
@ -361,11 +347,9 @@ inline void VisibilityManagerPrivate::saveConfig()
return;
auto config = view->containment()->config();
config.writeEntry("visibility", static_cast<int>(mode));
config.writeEntry("timerShow", timerShow.interval());
config.writeEntry("timerHide", timerHide.interval());
view->containment()->configNeedsSaving();
}
@ -375,15 +359,11 @@ inline void VisibilityManagerPrivate::restoreConfig()
return;
auto config = view->containment()->config();
timerShow.setInterval(config.readEntry("timerShow", 200));
timerHide.setInterval(config.readEntry("timerHide", 700));
auto mode = static_cast<Dock::Visibility>(config.readEntry("visibility", static_cast<int>(Dock::DodgeActive)));
emit q->timerShowChanged();
emit q->timerHideChanged();
setMode(mode);
}
@ -409,26 +389,22 @@ bool VisibilityManagerPrivate::event(QEvent *ev)
containsMouse = false;
emit q->containsMouseChanged();
updateHiddenState();
break;
case QEvent::DragEnter:
dragEnter = true;
emit q->mustBeShown();
break;
case QEvent::DragLeave:
case QEvent::Drop:
dragEnter = false;
updateHiddenState();
break;
case QEvent::Show:
wm->setDockDefaultFlags();
restoreConfig();
break;
}
@ -444,7 +420,6 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view)
VisibilityManager::~VisibilityManager()
{
}
Dock::Visibility VisibilityManager::mode() const

@ -31,7 +31,6 @@ WindowInfoWrap::WindowInfoWrap()
, m_isPlasmaDesktop(false)
, m_wid(0)
{
}
WindowInfoWrap::WindowInfoWrap(const WindowInfoWrap &other)
@ -49,7 +48,6 @@ WindowInfoWrap &WindowInfoWrap::operator=(const WindowInfoWrap &rhs)
m_isPlasmaDesktop = rhs.m_isPlasmaDesktop;
m_geometry = rhs.m_geometry;
m_wid = rhs.m_wid;
return *this;
}

@ -34,15 +34,12 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
: AbstractWindowInterface(view, parent)
{
Q_ASSERT(view != nullptr);
connections << connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged
, this, &AbstractWindowInterface::activeWindowChanged);
connections << connect(KWindowSystem::self()
, static_cast<void (KWindowSystem::*)(WId, NET::Properties, NET::Properties2)>
(&KWindowSystem::windowChanged)
, this, &XWindowInterface::windowChangedProxy);
auto addWindow = [&](WId wid) {
if (std::find(m_windows.cbegin(), m_windows.cend(), wid) == m_windows.cend()) {
if (isValidWindow(KWindowInfo(wid, NET::WMWindowType))) {
@ -51,16 +48,13 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
}
}
};
connections << connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, addWindow);
connections << connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, [this](WId wid) {
if (std::find(m_windows.cbegin(), m_windows.cend(), wid) != m_windows.end()) {
m_windows.remove(wid);
emit windowRemoved(wid);
}
});
connections << connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged
, this, &AbstractWindowInterface::currentDesktopChanged);
@ -87,12 +81,10 @@ void XWindowInterface::setDockDefaultFlags()
| Qt::WindowStaysOnTopHint
| Qt::NoDropShadowWindowHint
| Qt::WindowDoesNotAcceptFocus);
NETWinInfo winfo(QX11Info::connection()
, static_cast<xcb_window_t>(m_view->winId())
, static_cast<xcb_window_t>(m_view->winId())
, 0, 0);
winfo.setAllowedActions(NET::ActionChangeDesktop);
KWindowSystem::setType(m_view->winId(), NET::Dock);
KWindowSystem::setState(m_view->winId(), NET::SkipTaskbar | NET::SkipPager);
@ -144,7 +136,6 @@ void XWindowInterface::setDockStruts(const QRect &dockRect, Plasma::Types::Locat
return;
}
KWindowSystem::setExtendedStrut(m_view->winId(),
strut.left_width, strut.left_start, strut.left_end,
strut.right_width, strut.right_start, strut.right_end,
@ -171,12 +162,10 @@ bool XWindowInterface::isOnCurrentDesktop(WId wid) const
WindowInfoWrap XWindowInterface::requestInfo(WId wid) const
{
const KWindowInfo winfo{wid, NET::WMFrameExtents | NET::WMWindowType | NET::WMGeometry | NET::WMState};
WindowInfoWrap winfoWrap;
if (!winfo.valid()) {
return winfoWrap;
} else if (isValidWindow(winfo)) {
winfoWrap.setIsValid(true);
winfoWrap.setWid(wid);
@ -185,14 +174,12 @@ WindowInfoWrap XWindowInterface::requestInfo(WId wid) const
winfoWrap.setIsMaximized(winfo.hasState(NET::Max));
winfoWrap.setIsFullscreen(winfo.hasState(NET::FullScreen));
winfoWrap.setGeometry(winfo.geometry());
} else if (m_desktopId == wid) {
winfoWrap.setIsValid(true);
winfoWrap.setIsPlasmaDesktop(true);
winfoWrap.setWid(wid);
}
return winfoWrap;
}

@ -13,11 +13,10 @@
#FormattingOptions
--convert-tabs
--max-code-length=80
--max-code-length=200
--keep-one-line-blocks
--keep-one-line-statements
--close-templates
--max-code-length=200
#IndentationOptions
--indent-switches
@ -31,9 +30,9 @@
--pad-oper
--unpad-paren
--pad-header
--fill-empty-lines
--align-pointer=name
--align-reference=name
--delete-empty-lines
#Others
--preserve-date

@ -45,22 +45,16 @@ IconItem::IconItem(QQuickItem *parent)
m_sizeChanged(false)
{
setFlag(ItemHasContents, true);
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()),
this, SIGNAL(implicitWidthChanged()));
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()),
this, SIGNAL(implicitHeightChanged()));
connect(this, &QQuickItem::enabledChanged,
this, &IconItem::enabledChanged);
connect(this, &QQuickItem::windowChanged,
this, &IconItem::schedulePixmapUpdate);
connect(this, SIGNAL(overlaysChanged()),
this, SLOT(schedulePixmapUpdate()));
//initialize implicit size to the Dialog size
setImplicitWidth(KIconLoader::global()->currentSize(KIconLoader::Dialog));
setImplicitHeight(KIconLoader::global()->currentSize(KIconLoader::Dialog));
@ -106,7 +100,6 @@ void IconItem::setSource(const QVariant &source)
if (m_svgIcon->isValid() && m_svgIcon->hasElement(sourceString)) {
m_icon = QIcon();
m_svgIconName = sourceString;
//ok, svg not available from the plasma theme
} else {
//try to load from iconloader an svg with Plasma::Svg
@ -145,7 +138,6 @@ void IconItem::setSource(const QVariant &source)
}
}
}
} else if (source.canConvert<QIcon>()) {
m_icon = source.value<QIcon>();
m_imageIcon = QImage();
@ -272,7 +264,6 @@ QSGNode *IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update
if (m_sizeChanged) {
const auto iconSize = qMin(boundingRect().size().width(), boundingRect().size().height());
const QRectF destRect(QPointF(boundingRect().center() - QPointF(iconSize / 2, iconSize / 2)), QSizeF(iconSize, iconSize));
textureNode->setRect(destRect);
m_sizeChanged = false;
}
@ -297,7 +288,6 @@ void IconItem::loadPixmap()
}
const auto size = static_cast<int>(qMin(width(), height()));
//final pixmap to paint
QPixmap result;
@ -366,7 +356,6 @@ void IconItem::loadPixmap()
m_iconPixmap = result;
m_textureChanged = true;
//don't animate initial setting
update();
}

@ -28,9 +28,7 @@
void LatteDockPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.latte"));
qmlRegisterUncreatableType<Latte::Dock>(uri, 0, 1, "Dock", "Latte Dock Types uncreatable");
qmlRegisterType<Latte::WindowSystem>(uri, 0, 1, "WindowSystem");
qmlRegisterType<Latte::IconItem>(uri, 0, 1, "IconItem");
}

Loading…
Cancel
Save