Commit fa3ce94d authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Pass container as argument for touch method.

parent 1aa42527
......@@ -95,7 +95,7 @@ dtkWidgetsMenu *dtkWidgetsMainWindow::populateThemesMenu(void)
d->menu_themes = d->menubar->addMenu(fa::paintbrush, "Themes");
foreach (const QString theme, dtkThemesEngine::instance()->themes()) {
for (const QString theme : dtkThemesEngine::instance()->themes()) {
connect(static_cast<dtkWidgetsMenuItemCustom *>(d->menu_themes->addItem(new dtkWidgetsMenuItemTheme(theme))), &dtkWidgetsMenuItemCustom::clicked, [=] (void) -> void {
dtkThemesEngine::instance()->apply(theme);
});
......
......@@ -99,7 +99,7 @@ void dtkWidgetsMenuNavigationFacade::paintEvent(QPaintEvent *event)
dtkFontAwesome::instance()->setDefaultOption("color", ::fg_color);
QRect rect(5, 10, 28, 32); // qDebug() << Q_FUNC_INFO << rect;
QRect rect(5, 10, 28, 32);
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
......
......@@ -217,7 +217,7 @@ dtkWidgetsMenuBarContainerSlide::dtkWidgetsMenuBarContainerSlide(dtkWidgetsMenu
layout->setSpacing(0);
layout->setAlignment(Qt::AlignTop);
this->touch(m);
this->touch(m, c);
}
dtkWidgetsMenuBarContainerSlide::dtkWidgetsMenuBarContainerSlide(dtkWidgetsMenuBar *mb, dtkWidgetsMenuBarContainer *c) : QFrame(c), menu_bar(mb)
......@@ -230,7 +230,7 @@ dtkWidgetsMenuBarContainerSlide::dtkWidgetsMenuBarContainerSlide(dtkWidgetsMenuB
layout->setSpacing(0);
layout->setAlignment(Qt::AlignTop);
this->touch(mb);
this->touch(mb, c);
}
dtkWidgetsMenuBarContainerSlide::~dtkWidgetsMenuBarContainerSlide(void)
......@@ -239,15 +239,15 @@ dtkWidgetsMenuBarContainerSlide::~dtkWidgetsMenuBarContainerSlide(void)
menu_bar = nullptr;
}
void dtkWidgetsMenuBarContainerSlide::touch(dtkWidgetsMenu *m)
void dtkWidgetsMenuBarContainerSlide::touch(dtkWidgetsMenu *m, dtkWidgetsMenuBarContainer *c)
{
dtkWidgetsMenuFacade *facade = new dtkWidgetsMenuFacade(m);
this->layout()->addWidget(facade);
::dtkWidgetsMenuBarHelper::handle(facade->items(), static_cast<dtkWidgetsMenuBarContainer *>(this->parent()));
::dtkWidgetsMenuBarHelper::handle(facade->items(), c);
}
void dtkWidgetsMenuBarContainerSlide::touch(dtkWidgetsMenuBar *mb)
void dtkWidgetsMenuBarContainerSlide::touch(dtkWidgetsMenuBar *mb, dtkWidgetsMenuBarContainer *c)
{
QLayoutItem *item = nullptr; while ((item = this->layout()->takeAt(0))) delete item->widget();
......@@ -259,7 +259,7 @@ void dtkWidgetsMenuBarContainerSlide::touch(dtkWidgetsMenuBar *mb)
this->layout()->addWidget(header);
this->layout()->addWidget(widget);
::dtkWidgetsMenuBarHelper::handle(widget->items(), static_cast<dtkWidgetsMenuBarContainer *>(this->parent()), mb);
::dtkWidgetsMenuBarHelper::handle(widget->items(), c);
}
}
......@@ -364,7 +364,6 @@ void dtkWidgetsMenuBarContainer::switchToPrevSlide(dtkWidgetsMenu *m)
void dtkWidgetsMenuBarContainer::switchToNextSlide(dtkWidgetsMenu *m)
{
qDebug() << this->slides.count();
this->slider->addSlide(fa::cogs, this->slides[m]);
this->slider->slideToNext();
......@@ -375,17 +374,16 @@ void dtkWidgetsMenuBarContainer::switchToNextSlide(dtkWidgetsMenu *m)
void dtkWidgetsMenuBarContainer::touch(dtkWidgetsMenuBar *mb)
{
qDebug() << Q_FUNC_INFO << "Oh fastchedecon";
if(!this->master_slide) {
this->master_slide = new dtkWidgetsMenuBarContainerSlide(mb, this);
this->slider->addSlide(fa::cogs, this->master_slide);
} else {
qDeleteAll(this->slides);
this->slides.clear();
this->master_slide->touch(mb);
this->master_slide->touch(mb, this);
}
for (auto m : mb->menus())
......
......@@ -92,8 +92,8 @@ public:
bool isMaster(void) const { return (menu_bar != nullptr); }
public:
void touch(dtkWidgetsMenuBar *);
void touch(dtkWidgetsMenu *);
void touch(dtkWidgetsMenuBar *, dtkWidgetsMenuBarContainer *);
void touch(dtkWidgetsMenu *, dtkWidgetsMenuBarContainer *);
private:
dtkWidgetsMenu *menu = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment