mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
refine pure theme
This commit is contained in:
parent
21893fdff8
commit
719c7339cf
@ -66,7 +66,7 @@ void CoreConfig::init(const QJsonObject &p_app,
|
|||||||
|
|
||||||
m_docksTabBarIconSize = READINT(QStringLiteral("docks_tabbar_icon_size"));
|
m_docksTabBarIconSize = READINT(QStringLiteral("docks_tabbar_icon_size"));
|
||||||
if (m_docksTabBarIconSize <= 0) {
|
if (m_docksTabBarIconSize <= 0) {
|
||||||
m_docksTabBarIconSize = 20;
|
m_docksTabBarIconSize = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadNoteManagement(appObj, userObj);
|
loadNoteManagement(appObj, userObj);
|
||||||
|
@ -119,4 +119,5 @@ QString MainConfig::getVersion(const QJsonObject &p_jobj)
|
|||||||
void MainConfig::doVersionSpecificOverride()
|
void MainConfig::doVersionSpecificOverride()
|
||||||
{
|
{
|
||||||
// In a new version, we may want to change one value by force.
|
// In a new version, we may want to change one value by force.
|
||||||
|
m_coreConfig->m_docksTabBarIconSize = 18;
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ QString Theme::paletteColor(const QString &p_name) const
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
qWarning() << "undefined or invalid palette color" << p_name;
|
qWarning() << "undefined or invalid palette color" << p_name;
|
||||||
return QString("#ff0000");
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject Theme::readJsonFile(const QString &p_filePath)
|
QJsonObject Theme::readJsonFile(const QString &p_filePath)
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
<file>icons/view.svg</file>
|
<file>icons/view.svg</file>
|
||||||
<file>icons/inplace_preview_editor.svg</file>
|
<file>icons/inplace_preview_editor.svg</file>
|
||||||
<file>icons/image_host_editor.svg</file>
|
<file>icons/image_host_editor.svg</file>
|
||||||
<file>icons/settings_menu.svg</file>
|
|
||||||
<file>icons/help_menu.svg</file>
|
<file>icons/help_menu.svg</file>
|
||||||
<file>icons/import_menu.svg</file>
|
<file>icons/import_menu.svg</file>
|
||||||
<file>icons/export_menu.svg</file>
|
<file>icons/export_menu.svg</file>
|
||||||
|
@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1637134516381" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19374" width="512" height="512" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M993.31142 624.247465l-94.120714-73.598993c1.237983-11.349845 2.21797-24.617663 2.21797-38.655472s-1.023986-27.305627-2.21797-38.655471l94.206712-73.640994c17.493761-13.823811 22.313695-38.357476 11.135848-58.793196l-97.876662-169.341685c-10.709854-19.497733-34.729525-28.415612-56.617226-20.351721l-111.060481 44.58539c-21.24771-15.35979-43.561404-28.329613-66.645089-38.697471l-16.895769-117.800389C652.666077 16.895769 633.210343 0 610.212657 0h-196.263316c-22.997686 0-42.45342 16.895769-45.183383 38.869469l-16.937768 118.228383c-22.357694 10.111862-44.329394 22.869687-66.55909 38.741471l-111.358478-44.713389c-21.289709-8.319886-45.525378 0.469994-56.191231 20.009726l-98.004661 169.597682c-11.561842 19.541733-6.825907 44.885386 11.093849 59.049192l94.120713 73.556995c-1.49398 14.421803-2.21797 26.921632-2.21797 38.655471s0.72599 24.233669 2.133971 38.655472l-94.206712 73.684992C13.18682 638.157275 8.406885 662.68894 19.542733 683.12666l97.876662 169.341685c10.623855 19.455734 34.601527 28.329613 56.617226 20.351722l111.060481-44.585391c21.24771 15.317791 43.605404 28.287613 66.687088 38.697471l16.895769 117.75839c2.773962 22.399694 22.229696 39.295463 45.225382 39.295463h196.263317c22.997686 0 42.45342-16.895769 45.183382-38.869468l16.937769-118.184385c22.357694-10.111862 44.329394-22.869687 66.55909-38.74147l111.358477 44.713389c21.20571 8.233887 45.525378-0.469994 56.191232-20.009727l98.388655-170.195673c10.881851-19.965727 6.101917-44.499392-11.475843-58.451201z m-25.813648 37.545487l-101.63061 171.431656-122.15233-49.065329c-6.911906-2.773962-14.761798-1.705977-20.735716 2.729963-26.453638 19.797729-52.009289 34.687526-78.206931 45.397379a21.319709 21.319709 0 0 0-13.055822 16.725771l-21.545705 132.308192-199.123278-2.26197-18.645745-130.004222a21.409707 21.409707 0 0 0-13.055821-16.725771c-27.263627-11.177847-53.503269-26.409639-78.036933-45.269382a21.24571 21.24571 0 0 0-13.013823-4.437939c-2.687963 0-5.375927 0.469994-7.97789 1.535979L154.664885 831.558631l-97.876661-169.341685c-0.895988-1.663977-0.72599-3.583951 0.297996-4.39394l103.550584-80.936893a21.377708 21.377708 0 0 0 8.02189-19.455734c-2.261969-17.877756-3.285955-32.341558-3.285955-45.439379s1.065985-27.519624 3.285955-45.439379a21.337708 21.337708 0 0 0-8.02189-19.455734l-104.058578-84.860839 101.630611-171.431657 122.15233 49.06533c6.953905 2.815962 14.761798 1.749976 20.777716-2.729963 26.409639-19.839729 52.009289-34.687526 78.206931-45.397379a21.405707 21.405707 0 0 0 13.013822-16.725772l21.589705-132.35019 199.165277 2.303968 18.601745 130.046222a21.409707 21.409707 0 0 0 13.055822 16.725772c27.221628 11.135848 53.461269 26.36764 78.036933 45.269381 6.015918 4.607937 13.90981 5.717922 20.949713 2.857961l125.652283-47.401352 97.876661 169.341684c0.895988 1.663977 0.72599 3.541952-0.297996 4.351941l-103.550584 80.936893a21.337708 21.337708 0 0 0-8.02189 19.455734c1.621978 12.969823 3.285955 28.54361 3.285955 45.439379 0 16.937768-1.663977 32.469556-3.285955 45.439379a21.377708 21.377708 0 0 0 8.02189 19.455734l103.422586 80.894894c1.105985 0.895988 1.319982 2.815962 0.635991 4.009945z" p-id="19375" fill="#000000"></path><path d="M512.037999 298.661917c-117.630392 0-213.331083 95.700692-213.331083 213.331083s95.700692 213.331083 213.331083 213.331083S725.369083 629.623392 725.369083 511.993s-95.700692-213.331083-213.331084-213.331083z m0 383.99475c-94.120713 0-170.663667-76.542954-170.663666-170.663667s76.542954-170.663667 170.663666-170.663667 170.663667 76.542954 170.663667 170.663667-76.542954 170.663667-170.663667 170.663667z" p-id="19376" fill="#000000"></path></svg>
|
|
Before Width: | Height: | Size: 3.9 KiB |
@ -91,7 +91,7 @@
|
|||||||
],
|
],
|
||||||
"shortcut_leader_key" : "Ctrl+G",
|
"shortcut_leader_key" : "Ctrl+G",
|
||||||
"toolbar_icon_size" : 18,
|
"toolbar_icon_size" : 18,
|
||||||
"docks_tabbar_icon_size" : 24,
|
"docks_tabbar_icon_size" : 18,
|
||||||
"note_management" : {
|
"note_management" : {
|
||||||
"external_node" : {
|
"external_node" : {
|
||||||
"//comment" : "Wildcard patterns of files and folders to exclude as external files",
|
"//comment" : "Wildcard patterns of files and folders to exclude as external files",
|
||||||
@ -494,7 +494,7 @@
|
|||||||
"//comment" : "Docks to ignore when expanding content area of main window",
|
"//comment" : "Docks to ignore when expanding content area of main window",
|
||||||
"main_window_keep_docks_expanding_content_area": ["OutlineDock.vnotex"],
|
"main_window_keep_docks_expanding_content_area": ["OutlineDock.vnotex"],
|
||||||
"snippet_panel_builtin_snippets_visible" : true,
|
"snippet_panel_builtin_snippets_visible" : true,
|
||||||
"tag_explorer_two_columns_enabled" : true,
|
"tag_explorer_two_columns_enabled" : false,
|
||||||
"new_note_default_file_type" : 0,
|
"new_note_default_file_type" : 0,
|
||||||
"united_entry_expand_all" : false
|
"united_entry_expand_all" : false
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ QMainWindow > QTabBar::tab:right {
|
|||||||
border-right: 3px solid transparent;
|
border-right: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 6px 2px -10px 2px;
|
padding: 8px 8px -8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
/* Tabified QDockWidget */
|
||||||
@ -549,7 +549,7 @@ QMainWindow > QTabBar::tab:left {
|
|||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: -10px 2px 6px 2px;
|
padding: -8px 8px 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QTabBar::tab:hover {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metadata" : {
|
"metadata" : {
|
||||||
"revision" : 0,
|
"revision" : 1,
|
||||||
"//comment" : "If there is a file named 'editor-highlight.theme' under theme folder, this value will be ignored.",
|
"//comment" : "If there is a file named 'editor-highlight.theme' under theme folder, this value will be ignored.",
|
||||||
"//comment" : "Otherwise, this value specify the theme name to use for syntax highlighting.",
|
"//comment" : "Otherwise, this value specify the theme name to use for syntax highlighting.",
|
||||||
"editor-highlight-theme" : "Breeze Dark",
|
"editor-highlight-theme" : "Breeze Dark",
|
||||||
|
@ -77,6 +77,25 @@ vnotex--TitleBar QLabel[TitleBarTitle="true"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* QDockWidget */
|
/* QDockWidget */
|
||||||
|
QDockWidget[MainWindowSideBar="true"] QWidget {
|
||||||
|
background-color: @widgets#mainwindow#side_bar#widget#bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget[MainWindowSideBar="true"] QToolButton:checked {
|
||||||
|
color: @widgets#qtoolbutton#checked#fg;
|
||||||
|
background-color: @widgets#qtoolbutton#checked#bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget[MainWindowSideBar="true"] QToolButton:hover {
|
||||||
|
color: @widgets#qtoolbutton#hover#fg;
|
||||||
|
background-color: @widgets#qtoolbutton#hover#bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget[MainWindowSideBar="true"] QToolButton:pressed {
|
||||||
|
color: @widgets#qtoolbutton#pressed#fg;
|
||||||
|
background-color: @widgets#qtoolbutton#pressed#bg;
|
||||||
|
}
|
||||||
|
|
||||||
QDockWidget {
|
QDockWidget {
|
||||||
color: @widgets#qdockwidget#fg;
|
color: @widgets#qdockwidget#fg;
|
||||||
background-color: @widgets#qdockwidget#bg;
|
background-color: @widgets#qdockwidget#bg;
|
||||||
@ -504,6 +523,41 @@ QTabWidget::tab-bar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* QTabBar */
|
/* QTabBar */
|
||||||
|
QTabBar[MainWindowSideBar="true"] {
|
||||||
|
background-color: @widgets#mainwindow#side_bar#bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar[MainWindowSideBar="true"]::tab {
|
||||||
|
color: @widgets#mainwindow#side_bar#fg;
|
||||||
|
background-color: @widgets#mainwindow#side_bar#bg;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMainWindow > QTabBar::tab:right {
|
||||||
|
border-right: 3px solid transparent;
|
||||||
|
border-bottom: none;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 8px 8px -8px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMainWindow > QTabBar::tab:left {
|
||||||
|
border-left: 3px solid transparent;
|
||||||
|
border-bottom: none;
|
||||||
|
margin: 0px;
|
||||||
|
padding: -8px 8px 8px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only the left one is the mainwindow side bar */
|
||||||
|
QMainWindow > QTabBar::tab:left:hover {
|
||||||
|
color: @widgets#mainwindow#side_bar#hover#fg;
|
||||||
|
background-color: @widgets#mainwindow#side_bar#hover#bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMainWindow > QTabBar::tab:left:selected {
|
||||||
|
color: @widgets#mainwindow#side_bar#selected#fg;
|
||||||
|
background-color: @widgets#mainwindow#side_bar#selected#bg;
|
||||||
|
}
|
||||||
|
|
||||||
QTabBar {
|
QTabBar {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
@ -536,22 +590,6 @@ QTabBar::tab:left {
|
|||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
|
||||||
QMainWindow > QTabBar::tab:right {
|
|
||||||
border-right: 3px solid transparent;
|
|
||||||
border-bottom: none;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 6px 2px -10px 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
|
||||||
QMainWindow > QTabBar::tab:left {
|
|
||||||
border-left: 3px solid transparent;
|
|
||||||
border-bottom: none;
|
|
||||||
margin: 0px;
|
|
||||||
padding: -10px 2px 6px 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QTabBar::tab:hover {
|
||||||
color: @widgets#qtabbar#tab#hover#fg;
|
color: @widgets#qtabbar#tab#hover#fg;
|
||||||
background-color: @widgets#qtabbar#tab#hover#bg;
|
background-color: @widgets#qtabbar#tab#hover#bg;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metadata" : {
|
"metadata" : {
|
||||||
"revision" : 0,
|
"revision" : 1,
|
||||||
"//comment" : "If there is a file named 'editor-highlight.theme' under theme folder, this value will be ignored.",
|
"//comment" : "If there is a file named 'editor-highlight.theme' under theme folder, this value will be ignored.",
|
||||||
"//comment" : "Otherwise, this value specify the theme name to use for syntax highlighting.",
|
"//comment" : "Otherwise, this value specify the theme name to use for syntax highlighting.",
|
||||||
"editor-highlight-theme" : "Default",
|
"editor-highlight-theme" : "Default",
|
||||||
@ -38,7 +38,11 @@
|
|||||||
"fg15_3" : "#b0b0b0",
|
"fg15_3" : "#b0b0b0",
|
||||||
"fg15_4" : "#7a7a7a",
|
"fg15_4" : "#7a7a7a",
|
||||||
"fg15_5" : "#222222",
|
"fg15_5" : "#222222",
|
||||||
"bg11" : "#1976d2"
|
"bg11" : "#1976d2",
|
||||||
|
"layer1" : "#354259",
|
||||||
|
"layer2" : "#1b2430",
|
||||||
|
"layer3" : "#6b778d",
|
||||||
|
"layer4" : "#eeeeee"
|
||||||
},
|
},
|
||||||
"base" : {
|
"base" : {
|
||||||
"normal" : {
|
"normal" : {
|
||||||
@ -260,7 +264,7 @@
|
|||||||
"fg" : "@base#normal#fg",
|
"fg" : "@base#normal#fg",
|
||||||
"bg" : "@base#normal#bg",
|
"bg" : "@base#normal#bg",
|
||||||
"separator" : {
|
"separator" : {
|
||||||
"bg" : "@widgets#separator#bg"
|
"bg" : "transparent"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dragdropareaindicator" : {
|
"dragdropareaindicator" : {
|
||||||
@ -490,7 +494,7 @@
|
|||||||
"bg" : "@base#footer#bg"
|
"bg" : "@base#footer#bg"
|
||||||
},
|
},
|
||||||
"qscrollbar" : {
|
"qscrollbar" : {
|
||||||
"bg" : "@base#normal#bg",
|
"bg" : "transparent",
|
||||||
"addpage" : {
|
"addpage" : {
|
||||||
"bg" : "transparent"
|
"bg" : "transparent"
|
||||||
},
|
},
|
||||||
@ -631,6 +635,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mainwindow" : {
|
"mainwindow" : {
|
||||||
|
"side_bar" : {
|
||||||
|
"fg" : "@palette#bg3_5",
|
||||||
|
"bg" : "@palette#layer1",
|
||||||
|
"selected" : {
|
||||||
|
"fg" : "@palette#bg2_7",
|
||||||
|
"bg" : "@palette#layer2"
|
||||||
|
},
|
||||||
|
"icon" : {
|
||||||
|
"fg" : "@widgets#mainwindow#side_bar#fg",
|
||||||
|
"selected" : {
|
||||||
|
"fg" : "@widgets#mainwindow#side_bar#selected#fg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hover" : {
|
||||||
|
"bg" : "@palette#layer3"
|
||||||
|
},
|
||||||
|
"widget" : {
|
||||||
|
"bg" : "@palette#layer4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dockwidget_tabbar" : {
|
"dockwidget_tabbar" : {
|
||||||
"icon" : {
|
"icon" : {
|
||||||
"fg" : "@base#icon#fg",
|
"fg" : "@base#icon#fg",
|
||||||
|
@ -537,7 +537,7 @@ QMainWindow > QTabBar::tab:right {
|
|||||||
border-right: 3px solid transparent;
|
border-right: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 6px 2px -10px 2px;
|
padding: 8px 8px -8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
/* Tabified QDockWidget */
|
||||||
@ -545,7 +545,7 @@ QMainWindow > QTabBar::tab:left {
|
|||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: -10px 2px 6px 2px;
|
padding: -8px 8px 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QTabBar::tab:hover {
|
||||||
|
@ -537,7 +537,7 @@ QMainWindow > QTabBar::tab:right {
|
|||||||
border-right: 3px solid transparent;
|
border-right: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 6px 2px -10px 2px;
|
padding: 8px 8px -8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
/* Tabified QDockWidget */
|
||||||
@ -545,7 +545,7 @@ QMainWindow > QTabBar::tab:left {
|
|||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: -10px 2px 6px 2px;
|
padding: -8px 8px 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QTabBar::tab:hover {
|
||||||
|
@ -537,7 +537,7 @@ QMainWindow > QTabBar::tab:right {
|
|||||||
border-right: 3px solid transparent;
|
border-right: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 6px 2px -10px 2px;
|
padding: 8px 8px -8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabified QDockWidget */
|
/* Tabified QDockWidget */
|
||||||
@ -545,7 +545,7 @@ QMainWindow > QTabBar::tab:left {
|
|||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: -10px 2px 6px 2px;
|
padding: -8px 8px 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QTabBar::tab:hover {
|
||||||
|
@ -127,6 +127,12 @@ void DockWidgetHelper::setupDocks()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void addWidgetToDock(QDockWidget *p_dock, QWidget *p_widget)
|
||||||
|
{
|
||||||
|
p_dock->setWidget(p_widget);
|
||||||
|
p_dock->setFocusProxy(p_widget);
|
||||||
|
}
|
||||||
|
|
||||||
void DockWidgetHelper::setupNavigationDock()
|
void DockWidgetHelper::setupNavigationDock()
|
||||||
{
|
{
|
||||||
auto dock = createDockWidget(DockIndex::NavigationDock, tr("Navigation"), m_mainWindow);
|
auto dock = createDockWidget(DockIndex::NavigationDock, tr("Navigation"), m_mainWindow);
|
||||||
@ -134,8 +140,7 @@ void DockWidgetHelper::setupNavigationDock()
|
|||||||
dock->setObjectName(QStringLiteral("NavigationDock.vnotex"));
|
dock->setObjectName(QStringLiteral("NavigationDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_notebookExplorer);
|
addWidgetToDock(dock, m_mainWindow->m_notebookExplorer);
|
||||||
dock->setFocusProxy(m_mainWindow->m_notebookExplorer);
|
|
||||||
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,8 +151,7 @@ void DockWidgetHelper::setupOutlineDock()
|
|||||||
dock->setObjectName(QStringLiteral("OutlineDock.vnotex"));
|
dock->setObjectName(QStringLiteral("OutlineDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_outlineViewer);
|
addWidgetToDock(dock, m_mainWindow->m_outlineViewer);
|
||||||
dock->setFocusProxy(m_mainWindow->m_outlineViewer);
|
|
||||||
m_mainWindow->addDockWidget(Qt::RightDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::RightDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +162,7 @@ void DockWidgetHelper::setupConsoleDock()
|
|||||||
dock->setObjectName(QStringLiteral("ConsoleDock.vnotex"));
|
dock->setObjectName(QStringLiteral("ConsoleDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_consoleViewer);
|
addWidgetToDock(dock, m_mainWindow->m_consoleViewer);
|
||||||
dock->setFocusProxy(m_mainWindow->m_consoleViewer);
|
|
||||||
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
|
||||||
dock->hide();
|
dock->hide();
|
||||||
}
|
}
|
||||||
@ -171,8 +174,7 @@ void DockWidgetHelper::setupSearchDock()
|
|||||||
dock->setObjectName(QStringLiteral("SearchDock.vnotex"));
|
dock->setObjectName(QStringLiteral("SearchDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_searchPanel);
|
addWidgetToDock(dock, m_mainWindow->m_searchPanel);
|
||||||
dock->setFocusProxy(m_mainWindow->m_searchPanel);
|
|
||||||
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,8 +185,7 @@ void DockWidgetHelper::setupSnippetDock()
|
|||||||
dock->setObjectName(QStringLiteral("SnippetDock.vnotex"));
|
dock->setObjectName(QStringLiteral("SnippetDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_snippetPanel);
|
addWidgetToDock(dock, m_mainWindow->m_snippetPanel);
|
||||||
dock->setFocusProxy(m_mainWindow->m_snippetPanel);
|
|
||||||
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +196,7 @@ void DockWidgetHelper::setupHistoryDock()
|
|||||||
dock->setObjectName(QStringLiteral("HistoryDock.vnotex"));
|
dock->setObjectName(QStringLiteral("HistoryDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_historyPanel);
|
addWidgetToDock(dock, m_mainWindow->m_historyPanel);
|
||||||
dock->setFocusProxy(m_mainWindow->m_historyPanel);
|
|
||||||
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,8 +207,7 @@ void DockWidgetHelper::setupTagDock()
|
|||||||
dock->setObjectName(QStringLiteral("TagDock.vnotex"));
|
dock->setObjectName(QStringLiteral("TagDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_tagExplorer);
|
addWidgetToDock(dock, m_mainWindow->m_tagExplorer);
|
||||||
dock->setFocusProxy(m_mainWindow->m_tagExplorer);
|
|
||||||
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,8 +218,7 @@ void DockWidgetHelper::setupLocationListDock()
|
|||||||
dock->setObjectName(QStringLiteral("LocationListDock.vnotex"));
|
dock->setObjectName(QStringLiteral("LocationListDock.vnotex"));
|
||||||
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
dock->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
dock->setWidget(m_mainWindow->m_locationList);
|
addWidgetToDock(dock, m_mainWindow->m_locationList);
|
||||||
dock->setFocusProxy(m_mainWindow->m_locationList);
|
|
||||||
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
|
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
|
||||||
dock->hide();
|
dock->hide();
|
||||||
}
|
}
|
||||||
@ -354,6 +352,12 @@ void DockWidgetHelper::updateDockWidgetTabBar()
|
|||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
iconOnly = false;
|
iconOnly = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSideBar = iconOnly && (tabShape == QTabBar::RoundedWest || tabShape == QTabBar::TriangularWest);
|
||||||
|
if (tabBar->property(PropertyDefs::c_mainWindowSideBar).toBool() != isSideBar) {
|
||||||
|
WidgetUtils::setPropertyDynamically(tabBar, PropertyDefs::c_mainWindowSideBar, isSideBar);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < cnt; ++i) {
|
for (int i = 0; i < cnt; ++i) {
|
||||||
auto dock = reinterpret_cast<QDockWidget *>(tabBar->tabData(i).toULongLong());
|
auto dock = reinterpret_cast<QDockWidget *>(tabBar->tabData(i).toULongLong());
|
||||||
if (!dock) {
|
if (!dock) {
|
||||||
@ -366,7 +370,11 @@ void DockWidgetHelper::updateDockWidgetTabBar()
|
|||||||
} else if (dock->windowTitle().isEmpty()) {
|
} else if (dock->windowTitle().isEmpty()) {
|
||||||
dock->setWindowTitle(dock->property(PropertyDefs::c_dockWidgetTitle).toString());
|
dock->setWindowTitle(dock->property(PropertyDefs::c_dockWidgetTitle).toString());
|
||||||
}
|
}
|
||||||
tabBar->setTabIcon(i, getDockIcon(static_cast<DockIndex>(dockIdx)));
|
tabBar->setTabIcon(i, getDockIcon(static_cast<DockIndex>(dockIdx), isSideBar));
|
||||||
|
|
||||||
|
if (dock->property(PropertyDefs::c_mainWindowSideBar).toBool() != isSideBar) {
|
||||||
|
WidgetUtils::setPropertyDynamically(dock, PropertyDefs::c_mainWindowSideBar, isSideBar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,21 +518,35 @@ QVector<void *> DockWidgetHelper::getVisibleNavigationItems()
|
|||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QIcon &DockWidgetHelper::getDockIcon(DockIndex p_dockIndex)
|
const QIcon &DockWidgetHelper::getDockIcon(DockIndex p_dockIndex, bool p_isSideBar)
|
||||||
{
|
{
|
||||||
static const auto fg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#dockwidget_tabbar#icon#fg");
|
static const auto fg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#dockwidget_tabbar#icon#fg");
|
||||||
static const auto selectedFg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#dockwidget_tabbar#icon#selected#fg");
|
static const auto selectedFg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#dockwidget_tabbar#icon#selected#fg");
|
||||||
|
static auto sideBarFg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#side_bar#icon#fg");
|
||||||
|
static auto sideBarSelectedFg = VNoteX::getInst().getThemeMgr().paletteColor("widgets#mainwindow#side_bar#icon#selected#fg");
|
||||||
|
|
||||||
|
if (sideBarFg.isEmpty()) {
|
||||||
|
sideBarFg = fg;
|
||||||
|
}
|
||||||
|
if (sideBarSelectedFg.isEmpty()) {
|
||||||
|
sideBarSelectedFg = selectedFg;
|
||||||
|
}
|
||||||
|
|
||||||
const auto area = m_mainWindow->dockWidgetArea(m_docks[p_dockIndex]);
|
const auto area = m_mainWindow->dockWidgetArea(m_docks[p_dockIndex]);
|
||||||
const int newAngle = rotationAngle(area);
|
const int newAngle = rotationAngle(area);
|
||||||
if (m_dockIcons[p_dockIndex].m_rotationAngle != newAngle && area != Qt::NoDockWidgetArea) {
|
if ((m_dockIcons[p_dockIndex].m_rotationAngle != newAngle
|
||||||
|
|| m_dockIcons[p_dockIndex].m_isSideBar != p_isSideBar)
|
||||||
|
&& area != Qt::NoDockWidgetArea) {
|
||||||
QVector<IconUtils::OverriddenColor> colors;
|
QVector<IconUtils::OverriddenColor> colors;
|
||||||
colors.push_back(IconUtils::OverriddenColor(fg, QIcon::Normal));
|
colors.push_back(IconUtils::OverriddenColor(p_isSideBar ? sideBarFg : fg, QIcon::Normal));
|
||||||
// FIXME: the Selected Mode is not used by the selected tab of a QTabBar.
|
// FIXME: the Selected Mode is not used by the selected tab of a QTabBar.
|
||||||
colors.push_back(IconUtils::OverriddenColor(selectedFg, QIcon::Selected));
|
colors.push_back(IconUtils::OverriddenColor(p_isSideBar ? sideBarSelectedFg : selectedFg,
|
||||||
|
QIcon::Selected));
|
||||||
|
|
||||||
auto iconFile = VNoteX::getInst().getThemeMgr().getIconFile(iconFileName(p_dockIndex));
|
auto iconFile = VNoteX::getInst().getThemeMgr().getIconFile(iconFileName(p_dockIndex));
|
||||||
m_dockIcons[p_dockIndex].m_icon = IconUtils::fetchIcon(iconFile, colors, newAngle);
|
m_dockIcons[p_dockIndex].m_icon = IconUtils::fetchIcon(iconFile, colors, newAngle);
|
||||||
m_dockIcons[p_dockIndex].m_rotationAngle = newAngle;
|
m_dockIcons[p_dockIndex].m_rotationAngle = newAngle;
|
||||||
|
m_dockIcons[p_dockIndex].m_isSideBar = p_isSideBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_dockIcons[p_dockIndex].m_icon;
|
return m_dockIcons[p_dockIndex].m_icon;
|
||||||
|
@ -92,6 +92,8 @@ namespace vnotex
|
|||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
|
|
||||||
int m_rotationAngle = INT_MIN;
|
int m_rotationAngle = INT_MIN;
|
||||||
|
|
||||||
|
bool m_isSideBar = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
void setupNavigationDock();
|
void setupNavigationDock();
|
||||||
@ -118,7 +120,7 @@ namespace vnotex
|
|||||||
|
|
||||||
void setupDockActivateShortcut(QDockWidget *p_dock, const QString &p_keys);
|
void setupDockActivateShortcut(QDockWidget *p_dock, const QString &p_keys);
|
||||||
|
|
||||||
const QIcon &getDockIcon(DockIndex p_dockIndex);
|
const QIcon &getDockIcon(DockIndex p_dockIndex, bool p_isSideBar);
|
||||||
|
|
||||||
static QString iconFileName(DockIndex p_dockIndex);
|
static QString iconFileName(DockIndex p_dockIndex);
|
||||||
|
|
||||||
|
@ -27,3 +27,5 @@ const char *PropertyDefs::c_dockWidgetIndex = "DockIndex";
|
|||||||
const char *PropertyDefs::c_dockWidgetTitle = "DockTitle";
|
const char *PropertyDefs::c_dockWidgetTitle = "DockTitle";
|
||||||
|
|
||||||
const char *PropertyDefs::c_hitSettingWidget = "HitSettingWidget";
|
const char *PropertyDefs::c_hitSettingWidget = "HitSettingWidget";
|
||||||
|
|
||||||
|
const char *PropertyDefs::c_mainWindowSideBar = "MainWindowSideBar";
|
||||||
|
@ -35,6 +35,8 @@ namespace vnotex
|
|||||||
static const char *c_dockWidgetTitle;
|
static const char *c_dockWidgetTitle;
|
||||||
|
|
||||||
static const char *c_hitSettingWidget;
|
static const char *c_hitSettingWidget;
|
||||||
|
|
||||||
|
static const char *c_mainWindowSideBar;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ TitleBar::TitleBar(const QString &p_title,
|
|||||||
bool p_hasInfoLabel,
|
bool p_hasInfoLabel,
|
||||||
TitleBar::Actions p_actionFlags,
|
TitleBar::Actions p_actionFlags,
|
||||||
QWidget *p_parent)
|
QWidget *p_parent)
|
||||||
: QWidget(p_parent)
|
: QFrame(p_parent)
|
||||||
{
|
{
|
||||||
setupUI(p_title, p_hasInfoLabel, p_actionFlags);
|
setupUI(p_title, p_hasInfoLabel, p_actionFlags);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef TITLEBAR_H
|
#ifndef TITLEBAR_H
|
||||||
#define TITLEBAR_H
|
#define TITLEBAR_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QFrame>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ class QLabel;
|
|||||||
|
|
||||||
namespace vnotex
|
namespace vnotex
|
||||||
{
|
{
|
||||||
class TitleBar : public QWidget
|
class TitleBar : public QFrame
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -405,8 +405,6 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
|||||||
|
|
||||||
setupExpandButton(p_win, tb);
|
setupExpandButton(p_win, tb);
|
||||||
|
|
||||||
setupSettingsButton(p_win, tb);
|
|
||||||
|
|
||||||
setupMenuButton(p_win, tb);
|
setupMenuButton(p_win, tb);
|
||||||
|
|
||||||
return tb;
|
return tb;
|
||||||
@ -586,11 +584,11 @@ void ToolBarHelper::setupExpandButton(MainWindow *p_win, QToolBar *p_toolBar)
|
|||||||
p_toolBar->addWidget(btn);
|
p_toolBar->addWidget(btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBarHelper::setupSettingsButton(MainWindow *p_win, QToolBar *p_toolBar)
|
void ToolBarHelper::setupMenuButton(MainWindow *p_win, QToolBar *p_toolBar)
|
||||||
{
|
{
|
||||||
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
|
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
|
||||||
|
|
||||||
auto act = p_toolBar->addAction(generateIcon("settings_menu.svg"), MainWindow::tr("Settings"));
|
auto act = p_toolBar->addAction(generateIcon("menu.svg"), MainWindow::tr("Menu"));
|
||||||
auto btn = dynamic_cast<QToolButton *>(p_toolBar->widgetForAction(act));
|
auto btn = dynamic_cast<QToolButton *>(p_toolBar->widgetForAction(act));
|
||||||
Q_ASSERT(btn);
|
Q_ASSERT(btn);
|
||||||
btn->setPopupMode(QToolButton::InstantPopup);
|
btn->setPopupMode(QToolButton::InstantPopup);
|
||||||
@ -599,6 +597,7 @@ void ToolBarHelper::setupSettingsButton(MainWindow *p_win, QToolBar *p_toolBar)
|
|||||||
auto menu = WidgetsFactory::createMenu(p_toolBar);
|
auto menu = WidgetsFactory::createMenu(p_toolBar);
|
||||||
btn->setMenu(menu);
|
btn->setMenu(menu);
|
||||||
|
|
||||||
|
{
|
||||||
auto settingsAct = menu->addAction(MainWindow::tr("Settings"),
|
auto settingsAct = menu->addAction(MainWindow::tr("Settings"),
|
||||||
menu,
|
menu,
|
||||||
[p_win]() {
|
[p_win]() {
|
||||||
@ -661,18 +660,7 @@ void ToolBarHelper::setupSettingsButton(MainWindow *p_win, QToolBar *p_toolBar)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBarHelper::setupMenuButton(MainWindow *p_win, QToolBar *p_toolBar)
|
menu->addSeparator();
|
||||||
{
|
|
||||||
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
|
|
||||||
|
|
||||||
auto act = p_toolBar->addAction(generateIcon("menu.svg"), MainWindow::tr("Menu"));
|
|
||||||
auto btn = dynamic_cast<QToolButton *>(p_toolBar->widgetForAction(act));
|
|
||||||
Q_ASSERT(btn);
|
|
||||||
btn->setPopupMode(QToolButton::InstantPopup);
|
|
||||||
btn->setProperty(PropertyDefs::c_toolButtonWithoutMenuIndicator, true);
|
|
||||||
|
|
||||||
auto menu = WidgetsFactory::createMenu(p_toolBar);
|
|
||||||
btn->setMenu(menu);
|
|
||||||
|
|
||||||
menu->addAction(MainWindow::tr("View Logs"),
|
menu->addAction(MainWindow::tr("View Logs"),
|
||||||
menu,
|
menu,
|
||||||
|
@ -46,8 +46,6 @@ namespace vnotex
|
|||||||
|
|
||||||
static void setupExpandButton(MainWindow *p_win, QToolBar *p_toolBar);
|
static void setupExpandButton(MainWindow *p_win, QToolBar *p_toolBar);
|
||||||
|
|
||||||
static void setupSettingsButton(MainWindow *p_win, QToolBar *p_toolBar);
|
|
||||||
|
|
||||||
static void setupMenuButton(MainWindow *p_win, QToolBar *p_toolBar);
|
static void setupMenuButton(MainWindow *p_win, QToolBar *p_toolBar);
|
||||||
|
|
||||||
static void activateQuickAccess(const QString &p_file);
|
static void activateQuickAccess(const QString &p_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user