ui: fix z-index of custom trail dialog and row height of "show directory path" option in preferences

This commit is contained in:
mlangkabel
2019-08-06 13:04:54 +02:00
parent 21f25a0b00
commit 3e9df0b074
12 changed files with 41 additions and 18 deletions
+2 -2
View File
@@ -69,9 +69,9 @@ std::shared_ptr<Component> ComponentFactory::createCodeComponent(ViewLayout* vie
return std::make_shared<Component>(view, controller);
}
std::shared_ptr<Component> ComponentFactory::createCustomTrailComponent()
std::shared_ptr<Component> ComponentFactory::createCustomTrailComponent(ViewLayout* viewLayout)
{
std::shared_ptr<CustomTrailView> view = m_viewFactory->createCustomTrailView();
std::shared_ptr<CustomTrailView> view = m_viewFactory->createCustomTrailView(viewLayout);
std::shared_ptr<CustomTrailController> controller = std::make_shared<CustomTrailController>(m_storageAccess);
return std::make_shared<Component>(view, controller);
+1 -1
View File
@@ -21,7 +21,7 @@ public:
std::shared_ptr<Component> createActivationComponent();
std::shared_ptr<Component> createBookmarkComponent(ViewLayout* viewLayout);
std::shared_ptr<Component> createCodeComponent(ViewLayout* viewLayout);
std::shared_ptr<Component> createCustomTrailComponent();
std::shared_ptr<Component> createCustomTrailComponent(ViewLayout* viewLayout);
std::shared_ptr<Component> createErrorComponent(ViewLayout* viewLayout);
std::shared_ptr<Component> createGraphComponent(ViewLayout* viewLayout);
std::shared_ptr<Component> createRefreshComponent(ViewLayout* viewLayout);
+1 -1
View File
@@ -99,7 +99,7 @@ void ComponentManager::setupMain(ViewLayout* viewLayout, Id appId)
std::shared_ptr<Component> statusBarComponent = m_componentFactory.createStatusBarComponent(viewLayout);
m_components.push_back(statusBarComponent);
std::shared_ptr<Component> customTrailComponent = m_componentFactory.createCustomTrailComponent();
std::shared_ptr<Component> customTrailComponent = m_componentFactory.createCustomTrailComponent(viewLayout);
m_components.push_back(customTrailComponent);
}
+1 -1
View File
@@ -39,7 +39,7 @@ public:
virtual std::shared_ptr<BookmarkButtonsView> createBookmarkButtonsView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<BookmarkView> createBookmarkView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<CustomTrailView> createCustomTrailView() const = 0;
virtual std::shared_ptr<CustomTrailView> createCustomTrailView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<ErrorView> createErrorView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
virtual std::shared_ptr<RefreshView> createRefreshView(ViewLayout* viewLayout) const = 0;
@@ -106,6 +106,7 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
// directory in code
m_showDirectoryInCode = addCheckBox("Directory in File Title", "Show directory of file in code title",
"<p>Enable display of the parent directory of a code file relative to the project file.</p>", layout, row);
layout->setRowMinimumHeight(row - 1, 30);
addGap(layout, row);
+10
View File
@@ -12,6 +12,7 @@
#include "FilePath.h"
#include "FileSystem.h"
#include "logging.h"
#include "QtMainView.h"
#include "ResourcePaths.h"
#include "TextAccess.h"
#include "utilityApp.h"
@@ -230,6 +231,15 @@ namespace utility
return icon;
}
QtMainWindow* getMainWindowforMainView(ViewLayout* viewLayout)
{
if (QtMainView* mainView = dynamic_cast<QtMainView*>(viewLayout))
{
return mainView->getMainWindow();
}
return nullptr;
}
void copyNewFilesFromDirectory(QString src, QString dst)
{
QDir dir(src);
+4
View File
@@ -9,6 +9,8 @@ class QIcon;
class QPixmap;
class QString;
class QWidget;
class QtMainWindow;
class ViewLayout;
namespace utility
{
@@ -22,6 +24,8 @@ namespace utility
QPixmap colorizePixmap(const QPixmap& pixmap, QColor color);
QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId);
QtMainWindow* getMainWindowforMainView(ViewLayout* viewLayout);
void copyNewFilesFromDirectory(QString src, QString dst);
}
+4 -2
View File
@@ -14,16 +14,18 @@
#include "MessageActivateTrail.h"
#include "NodeTypeSet.h"
#include "QtSmartSearchBox.h"
#include "QtMainWindow.h"
#include "ResourcePaths.h"
#include "TabId.h"
#include "utilityQt.h"
QtCustomTrailView::QtCustomTrailView(ViewLayout*)
: QWidget(nullptr)
QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
: QWidget(utility::getMainWindowforMainView(viewLayout))
, CustomTrailView(nullptr)
, m_controllerProxy(this, TabId::app())
{
setWindowTitle("Custom Trail");
setWindowFlags(Qt::Window);
QGridLayout* mainLayout = new QGridLayout();
mainLayout->setContentsMargins(0, 0, 0, 0);
+10 -6
View File
@@ -21,11 +21,13 @@ QtScreenSearchView::QtScreenSearchView(ViewLayout* viewLayout)
m_bar->setMovable(false);
m_bar->addWidget(m_widget);
QtMainWindow* mainWindow = dynamic_cast<QtMainView*>(getViewLayout())->getMainWindow();
QObject::connect(m_widget, &QtScreenSearchBox::closePressed, this, &QtScreenSearchView::hide);
QObject::connect(mainWindow, &QtMainWindow::showScreenSearch, this, &QtScreenSearchView::show);
QObject::connect(mainWindow, &QtMainWindow::hideScreenSearch, this, &QtScreenSearchView::hide);
if (QtMainWindow* mainWindow = utility::getMainWindowforMainView(getViewLayout()))
{
QObject::connect(mainWindow, &QtMainWindow::showScreenSearch, this, &QtScreenSearchView::show);
QObject::connect(mainWindow, &QtMainWindow::hideScreenSearch, this, &QtScreenSearchView::hide);
}
}
void QtScreenSearchView::createWidgetWrapper()
@@ -70,8 +72,10 @@ void QtScreenSearchView::addResponder(const std::string& name)
void QtScreenSearchView::show()
{
QtMainWindow* mainWindow = dynamic_cast<QtMainView*>(getViewLayout())->getMainWindow();
mainWindow->addToolBar(Qt::BottomToolBarArea, m_bar);
if (QtMainWindow* mainWindow = utility::getMainWindowforMainView(getViewLayout()))
{
mainWindow->addToolBar(Qt::BottomToolBarArea, m_bar);
}
m_bar->show();
m_widget->setFocus();
+2 -1
View File
@@ -6,11 +6,12 @@
#include "QtViewWidgetWrapper.h"
#include "QtMainWindow.h"
#include "ResourcePaths.h"
#include "utilityQt.h"
QtTooltipView::QtTooltipView(ViewLayout* viewLayout)
: TooltipView(viewLayout)
{
m_widget = new QtTooltip(dynamic_cast<QtMainView*>(viewLayout)->getMainWindow());
m_widget = new QtTooltip(utility::getMainWindowforMainView(viewLayout));
}
void QtTooltipView::createWidgetWrapper()
+4 -3
View File
@@ -20,6 +20,7 @@
#include "QtTabsView.h"
#include "QtTooltipView.h"
#include "QtUndoRedoView.h"
#include "utilityQt.h"
std::shared_ptr<MainView> QtViewFactory::createMainView(StorageAccess* storageAccess) const
{
@@ -52,9 +53,9 @@ std::shared_ptr<CodeView> QtViewFactory::createCodeView(ViewLayout* viewLayout)
return View::createAndAddToLayout<QtCodeView>(viewLayout);
}
std::shared_ptr<CustomTrailView> QtViewFactory::createCustomTrailView() const
std::shared_ptr<CustomTrailView> QtViewFactory::createCustomTrailView(ViewLayout* viewLayout) const
{
return View::create<QtCustomTrailView>(nullptr);
return View::create<QtCustomTrailView>(viewLayout);
}
std::shared_ptr<ErrorView> QtViewFactory::createErrorView(ViewLayout* viewLayout) const
@@ -110,7 +111,7 @@ std::shared_ptr<UndoRedoView> QtViewFactory::createUndoRedoView(ViewLayout* view
std::shared_ptr<DialogView> QtViewFactory::createDialogView(
ViewLayout* viewLayout, DialogView::UseCase useCase, StorageAccess* storageAccess) const
{
return std::make_shared<QtDialogView>(dynamic_cast<QtMainView*>(viewLayout)->getMainWindow(), useCase, storageAccess);
return std::make_shared<QtDialogView>(utility::getMainWindowforMainView(viewLayout), useCase, storageAccess);
}
std::shared_ptr<GraphViewStyleImpl> QtViewFactory::createGraphStyleImpl() const
+1 -1
View File
@@ -18,7 +18,7 @@ public:
std::shared_ptr<BookmarkButtonsView> createBookmarkButtonsView(ViewLayout* viewLayout) const override;
std::shared_ptr<BookmarkView> createBookmarkView(ViewLayout* viewLayout) const override;
std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const override;
std::shared_ptr<CustomTrailView> createCustomTrailView() const override;
std::shared_ptr<CustomTrailView> createCustomTrailView(ViewLayout* viewLayout) const override;
std::shared_ptr<ErrorView> createErrorView(ViewLayout* viewLayout) const override;
std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const override;
std::shared_ptr<RefreshView> createRefreshView(ViewLayout* viewLayout) const override;