Ran clang-format over the codebase
This commit is contained in:
@@ -62,7 +62,7 @@ public:
|
||||
f.setPixelSize(30);
|
||||
f.setBold(true);
|
||||
p.setFont(f);
|
||||
p.drawText(QPoint(10,40), title());
|
||||
p.drawText(QPoint(10, 40), title());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,19 +88,19 @@ public:
|
||||
|
||||
MySeparator::~MySeparator() = default;
|
||||
|
||||
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
|
||||
KDDockWidgets::TitleBar *CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
|
||||
{
|
||||
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
|
||||
return new MyTitleBar(frame);
|
||||
}
|
||||
|
||||
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const
|
||||
KDDockWidgets::TitleBar *CustomWidgetFactory::createTitleBar(KDDockWidgets::FloatingWindow *fw) const
|
||||
{
|
||||
// Feel free to return MyTitleBar_CSS here instead, but just for education purposes!
|
||||
return new MyTitleBar(fw);
|
||||
}
|
||||
|
||||
Layouting::Separator * CustomWidgetFactory::createSeparator(Layouting::Widget *parent) const
|
||||
Layouting::Separator *CustomWidgetFactory::createSeparator(Layouting::Widget *parent) const
|
||||
{
|
||||
return new MySeparator(parent);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
void createDockWidgets();
|
||||
KDDockWidgets::DockWidgetBase* newDockWidget();
|
||||
KDDockWidgets::DockWidgetBase *newDockWidget();
|
||||
QMenu *m_toggleMenu = nullptr;
|
||||
const bool m_dockWidget0IsNonClosable;
|
||||
const bool m_dockWidget9IsNonDockable;
|
||||
|
||||
@@ -66,7 +66,7 @@ void MyWidget::drawLogo(QPainter &p)
|
||||
: int(maxHeight / ratio);
|
||||
|
||||
const int height = int(width * ratio);
|
||||
QRect targetLogoRect(0,0, width, height);
|
||||
QRect targetLogoRect(0, 0, width, height);
|
||||
targetLogoRect.moveCenter(rect().center() + QPoint(0, -int(size().height() * 0.00)));
|
||||
p.drawImage(targetLogoRect, m_logo, m_logo.rect());
|
||||
}
|
||||
|
||||
@@ -43,8 +43,9 @@ class MyWidget1 : public MyWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget1(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
};
|
||||
|
||||
class MyWidget2 : public MyWidget
|
||||
@@ -52,8 +53,9 @@ class MyWidget2 : public MyWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget2(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
};
|
||||
|
||||
class MyWidget3 : public MyWidget
|
||||
@@ -61,8 +63,9 @@ class MyWidget3 : public MyWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget3(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
QImage m_triangle;
|
||||
};
|
||||
|
||||
|
||||
@@ -116,12 +116,12 @@ int main(int argc, char **argv)
|
||||
QCoreApplication::translate("main", "The title bar's close button will only close the current tab instead of all. Illustrates using Config::Flag_CloseOnlyCurrentTab"));
|
||||
parser.addOption(closeOnlyCurrentTab);
|
||||
|
||||
QCommandLineOption dontCloseBeforeRestore("dont-close-widget-before-restore", //krazy:exclude=spelling
|
||||
QCommandLineOption dontCloseBeforeRestore("dont-close-widget-before-restore", // krazy:exclude=spelling
|
||||
QCoreApplication::translate("main", "DockWidget #5 won't be closed before a restore. Illustrates LayoutSaverOption::DontCloseBeforeRestore"));
|
||||
parser.addOption(dontCloseBeforeRestore);
|
||||
|
||||
QCommandLineOption blockCloseEvent("block-close-event",
|
||||
QCoreApplication::translate("main", "DockWidget #0 will block close events"));
|
||||
QCoreApplication::translate("main", "DockWidget #0 will block close events"));
|
||||
parser.addOption(blockCloseEvent);
|
||||
|
||||
QCommandLineOption showButtonsInTabBarIfTitleBarHidden("show-buttons-in-tabbar-if-titlebar-hidden",
|
||||
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
|
||||
parser.addOption(ctxtMenuOnTabs);
|
||||
|
||||
QCommandLineOption hideCertainDockingIndicators("hide-certain-docking-indicators",
|
||||
QCoreApplication::translate("main", "Illustrates usage of Config::setDropIndicatorAllowedFunc()"));
|
||||
QCoreApplication::translate("main", "Illustrates usage of Config::setDropIndicatorAllowedFunc()"));
|
||||
parser.addOption(hideCertainDockingIndicators);
|
||||
|
||||
#if defined(DOCKS_DEVELOPER_MODE)
|
||||
@@ -153,10 +153,10 @@ int main(int argc, char **argv)
|
||||
parser.addOption(nativeTitleBar);
|
||||
parser.addOption(noDropIndicators);
|
||||
|
||||
# if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN)
|
||||
QCommandLineOption noAeroSnap("no-aero-snap", QCoreApplication::translate("main", "(internal) Disable AeroSnap"));
|
||||
parser.addOption(noAeroSnap);
|
||||
# endif
|
||||
#endif
|
||||
#else
|
||||
Q_UNUSED(centralFrame)
|
||||
#endif
|
||||
@@ -199,10 +199,10 @@ int main(int argc, char **argv)
|
||||
if (parser.isSet(noDropIndicators))
|
||||
KDDockWidgets::DefaultWidgetFactory::s_dropIndicatorType = KDDockWidgets::DropIndicatorType::None;
|
||||
|
||||
# if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (parser.isSet(noAeroSnap))
|
||||
internalFlags |= KDDockWidgets::Config::InternalFlag_NoAeroSnap;
|
||||
# endif
|
||||
#endif
|
||||
Config::self().setInternalFlags(internalFlags);
|
||||
#endif
|
||||
|
||||
@@ -271,9 +271,10 @@ int main(int argc, char **argv)
|
||||
KDDockWidgets::DropArea *) {
|
||||
Q_UNUSED(target); // When dragging into a tab, 'target' would have the list of already tabbed dock widgets
|
||||
|
||||
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [] (KDDockWidgets::DockWidgetBase *dw) {
|
||||
return dw->uniqueName() == QLatin1String("DockWidget #8");
|
||||
}) != source.cend();
|
||||
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [](KDDockWidgets::DockWidgetBase *dw) {
|
||||
return dw->uniqueName() == QLatin1String("DockWidget #8");
|
||||
})
|
||||
!= source.cend();
|
||||
|
||||
return (location & KDDockWidgets::DropLocation_Outter) || !isDraggingDW8;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user