ui: use wstring in gui relates places

* loading icons
* loading fonts
* context menu action for copy path to clipboard
* context menu action for open containing folder
This commit is contained in:
mlangkabel
2018-02-19 12:45:47 +01:00
parent ed386fdbdf
commit fc92cb1ad9
23 changed files with 75 additions and 63 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ QtBookmark::QtBookmark(ControllerProxy<BookmarkController>* controllerProxy)
m_editButton->setToolTip("Edit bookmark");
m_editButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_editButton->setIconSize(QSize(20, 20));
m_editButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_edit_icon.png").c_str()));
m_editButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_edit_icon.png").wstr())));
utility::setWidgetRetainsSpaceWhenHidden(m_editButton);
m_editButton->hide();
buttonsLayout->addWidget(m_editButton);
@@ -65,7 +65,7 @@ QtBookmark::QtBookmark(ControllerProxy<BookmarkController>* controllerProxy)
m_deleteButton->setToolTip("Delete bookmark");
m_deleteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_deleteButton->setIconSize(QSize(20, 20));
m_deleteButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_delete_icon.png").c_str()));
m_deleteButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_delete_icon.png").wstr())));
utility::setWidgetRetainsSpaceWhenHidden(m_deleteButton);
m_deleteButton->hide();
buttonsLayout->addWidget(m_deleteButton);
@@ -25,7 +25,7 @@ QtBookmarkCategory::QtBookmarkCategory(ControllerProxy<BookmarkController>* cont
m_expandButton->setObjectName("category_expand_button");
m_expandButton->setToolTip("Show/Hide bookmarks in this category");
m_expandButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_expandButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_down.png").c_str()));
m_expandButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_down.png").wstr())));
m_expandButton->setIconSize(QSize(8, 8));
layout->addWidget(m_expandButton);
@@ -42,7 +42,7 @@ QtBookmarkCategory::QtBookmarkCategory(ControllerProxy<BookmarkController>* cont
m_deleteButton->setToolTip("Delete this Bookmark Category and the containing Bookmarks");
m_deleteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_deleteButton->setIconSize(QSize(20, 20));
m_deleteButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_delete_icon.png").c_str()));
m_deleteButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_delete_icon.png").wstr())));
utility::setWidgetRetainsSpaceWhenHidden(m_deleteButton);
m_deleteButton->hide();
layout->addWidget(m_deleteButton);
@@ -85,12 +85,12 @@ void QtBookmarkCategory::updateArrow()
{
if (m_treeItem->isExpanded())
{
QPixmap pixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_down.png").c_str());
QPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_down.png").wstr()));
m_expandButton->setIcon(QIcon(utility::colorizePixmap(pixmap, "black")));
}
else
{
QPixmap pixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_right.png").c_str());
QPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_right.png").wstr()));
m_expandButton->setIcon(QIcon(utility::colorizePixmap(pixmap, "black")));
}
}
@@ -72,9 +72,9 @@ void QtCodeFileTitleButton::setIsComplete(bool isComplete)
utility::decodeFromUtf8(ColorScheme::getInstance()->getColor("code/file/title/hatching")) + L".png"
);
setStyleSheet((
"#title_button { background-image: url(" + hatchingFilePath.str() + "); }"
).c_str());
setStyleSheet(QString::fromStdWString(
L"#title_button { background-image: url(" + hatchingFilePath.wstr() + L"); }"
));
}
else
{
+12 -8
View File
@@ -30,8 +30,9 @@ QtListItemWidget::QtListItemWidget(QtDirectoryListBox* list, QListWidgetItem* it
m_data->setAcceptDrops(false);
m_button = new QtIconButton(
(ResourcePaths::getGuiPath().str() + "window/dots.png").c_str(),
(ResourcePaths::getGuiPath().str() + "window/dots_hover.png").c_str());
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots.png").wstr()),
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots_hover.png").wstr())
);
m_button->setIconSize(QSize(16, 16));
m_button->setObjectName("dotsButton");
@@ -152,16 +153,18 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName,
innerLayout->setSpacing(0);
m_addButton = new QtIconButton(
(ResourcePaths::getGuiPath().str() + "window/plus.png").c_str(),
(ResourcePaths::getGuiPath().str() + "window/plus_hover.png").c_str());
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/plus.png").wstr()),
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/plus_hover.png").wstr())
);
m_addButton->setIconSize(QSize(16, 16));
m_addButton->setObjectName("plusButton");
m_addButton->setToolTip("add line");
innerLayout->addWidget(m_addButton);
m_removeButton = new QtIconButton(
(ResourcePaths::getGuiPath().str() + "window/minus.png").c_str(),
(ResourcePaths::getGuiPath().str() + "window/minus_hover.png").c_str());
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/minus.png").wstr()),
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/minus_hover.png").wstr())
);
m_removeButton->setIconSize(QSize(16, 16));
m_removeButton->setObjectName("minusButton");
m_removeButton->setToolTip("remove line");
@@ -176,8 +179,9 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName,
innerLayout->addWidget(dropInfoText);
QPushButton* editButton = new QtIconButton(
(ResourcePaths::getGuiPath().str() + "code_view/images/edit.png").c_str(),
QString());
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"code_view/images/edit.png").wstr()),
QString()
);
editButton->setIconSize(QSize(16, 16));
editButton->setObjectName("editButton");
editButton->setToolTip("edit plain text");
+4 -3
View File
@@ -28,8 +28,9 @@ QtLocationPicker::QtLocationPicker(QWidget *parent)
layout->addWidget(m_data);
m_button = new QtIconButton(
(ResourcePaths::getGuiPath().str() + "window/dots.png").c_str(),
(ResourcePaths::getGuiPath().str() + "window/dots_hover.png").c_str());
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots.png").wstr()),
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots_hover.png").wstr())
);
m_button->setIconSize(QSize(16, 16));
m_button->setObjectName("dotsButton");
m_button->setToolTip("pick file");
@@ -123,7 +124,7 @@ void QtLocationPicker::handleButtonPress()
const FilePath relPath = path.getRelativeTo(m_relativeRootDirectory);
if (relPath.str().size() < path.str().size())
{
fileName = QString::fromStdString(relPath.str());
fileName = QString::fromStdWString(relPath.wstr());
}
}