Commit 4f0b0021 authored by WINTZ Julien's avatar WINTZ Julien

Sorry. Fixed my LSP setup. Fallback to default clangd.

parent b37eedb1
......@@ -30,5 +30,11 @@ build-*
install
install*
## ###################################################################
## TODO: LSP helpers
## ###################################################################
compile_commands.json
######################################################################
### .gitignore ends here
......@@ -229,5 +229,11 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT widgets)
## ###################################################################
##
## ###################################################################
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/compile_commands.json ${CMAKE_SOURCE_DIR}/compile_commands.json)
######################################################################
### CMakeLists.txt ends here
......@@ -15,11 +15,20 @@
#include "dtkWidgetsMainWindow.h"
#include "dtkWidgetsMenu.h"
#include "dtkWidgetsMenuBar.h"
#include "dtkWidgetsMenuItem.h"
#include <dtkFonts>
class dtkWidgetsMainWindowPrivate
{
public:
dtkWidgetsMenuBar *menubar = nullptr;
public:
dtkWidgetsMenu *menu_files;
dtkWidgetsMenu *menu_window;
dtkWidgetsMenu *menu_themes;
dtkWidgetsMenu *menu_about;
};
dtkWidgetsMainWindow::dtkWidgetsMainWindow(QWidget *parent) : dtkThemesWidgetsMainWindow(parent)
......@@ -34,9 +43,31 @@ dtkWidgetsMainWindow::~dtkWidgetsMainWindow(void)
dtkWidgetsMenuBar *dtkWidgetsMainWindow::menubar(void)
{
if(!d->menubar)
if(!d->menubar) {
d->menubar = new dtkWidgetsMenuBar(this);
d->menu_files = d->menubar->addMenu(fa::file, "Files");
d->menu_files->addItem(0, "Open");
d->menu_files->addItem(0, "Open Recent");
d->menu_files->addItem(0, "Save");
d->menu_files->addItem(0, "Save As");
d->menu_files->addItem(0, "Close");
d->menu_files->addItem(0, "Close All");
d->menu_window = d->menubar->addMenu(fa::windowmaximize, "Windows");
d->menu_window->addItem(0, "Minimize");
d->menu_window->addItem(0, "Maximize");
d->menu_window->addItem(0, "Close");
d->menu_themes = d->menubar->addMenu(fa::paintbrush, "Themes");
// for
d->menu_about = d->menubar->addMenu(fa::question, "About");
d->menu_about->addMenu(fa::question, "dtk");
d->menu_about->addMenu(fa::question, "dtk environment (conda)");
}
return d->menubar;
}
......
......@@ -23,6 +23,8 @@
#include <dtkFonts>
#include <QtGui/qcolor.h>
// ///////////////////////////////////////////////////////////////////
// TODO: Globals (Shame on me)
// ///////////////////////////////////////////////////////////////////
......@@ -399,14 +401,14 @@ void dtkWidgetsMenuBarContainer::setCurrentIndex(int index, std::function<void (
this->slider->blockSignals(true);
static std::function<void (void)> ca = [=] (void) -> void {
this->slider->blockSignals(false);
this->slider->enableSpying(true);
callback();
};
std::function<void (void)> cb = [=] (void) -> void {
this->slider->setCurrentIndex(index, ca);
};
......@@ -422,7 +424,7 @@ void dtkWidgetsMenuBarContainer::switchToRoot(std::function<void(void)> &callbac
this->slider->enableSpying(false);
this->slider->blockSignals(true);
static std::function<void(void)> cb = [=](void) -> void {
while (!::stack.isEmpty())
......
......@@ -14,8 +14,9 @@
#pragma once
#include <dtkWidgetsExport>
#include <dtkWidgetsExport.h>
#include <QtCore>
#include <QtWidgets>
#include <dtkFonts>
......@@ -29,7 +30,7 @@ class dtkWidgetsMenu;
class dtkWidgetsMenuBarButton : public QLabel
{
Q_OBJECT
public:
dtkWidgetsMenuBarButton(int id, const QString &title, QWidget *parent = nullptr);
......@@ -60,7 +61,7 @@ private:
class DTKWIDGETS_EXPORT dtkWidgetsMenuBar : public QFrame
{
Q_OBJECT
public:
dtkWidgetsMenuBar(QWidget * = nullptr);
~dtkWidgetsMenuBar(void);
......
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