Commit 2de677e8 authored by camilo higuita's avatar camilo higuita

Merge branch 'master' of invent.kde.org:kde/buho into development

parents 0b62b34e de086929
mauikit/
3rdparty/
3rdparty/kirigami
3rdparty/breeze-icons
.directory
......
project(buho)
cmake_minimum_required(VERSION 3.0)
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
find_package(MauiKit REQUIRED)
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(FeatureSummary)
include(ECMAddAppIcon)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTORCC ON)
add_definitions( -Wall -O2 -fexceptions -std=c99)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/QGumboParser
${CMAKE_CURRENT_BINARY_DIR}/QGumboParser
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/utils
${CMAKE_CURRENT_BINARY_DIR}/src/utils
)
set(buho_SRCS
main.cpp
src/db/db.cpp
src/buho.cpp
src/linker.cpp
src/utils/htmlparser.cpp
src/models/notes/notes.cpp
src/models/links/links.cpp
src/models/basemodel.cpp
src/models/baselist.cpp
)
set(buho_HDRS
src/db/db.h
src/buho.h
src/utils/owl.h
src/linker.h
src/utils/htmlparser.h
src/models/notes/notes.h
src/models/links/links.h
src/models/basemodel.h
src/models/baselist.h
)
set(buho_ASSETS
qml.qrc
assets/assets.qrc
)
set(qgumbo_SRCS
QGumboParser/qgumbodocument.cpp
QGumboParser/qgumbonode.cpp
QGumboParser/qgumboattribute.cpp
QGumboParser/gumbo-parser/src/attribute.c
QGumboParser/gumbo-parser/src/char_ref.c
QGumboParser/gumbo-parser/src/error.c
QGumboParser/gumbo-parser/src/parser.c
QGumboParser/gumbo-parser/src/string_buffer.c
QGumboParser/gumbo-parser/src/string_piece.c
QGumboParser/gumbo-parser/src/tag.c
QGumboParser/gumbo-parser/src/tokenizer.c
QGumboParser/gumbo-parser/src/utf8.c
QGumboParser/gumbo-parser/src/util.c
QGumboParser/gumbo-parser/src/vector.c
)
set(qgumbo_HDRS
QGumboParser/qgumboattribute.h
QGumboParser/qgumbodocument.h
QGumboParser/HtmlTag.h
QGumboParser/qgumbonode.h
QGumboParser/gumbo-parser/src/attribute.h
QGumboParser/gumbo-parser/src/char_ref.h
QGumboParser/gumbo-parser/src/char_ref.rl
QGumboParser/gumbo-parser/src/error.h
QGumboParser/gumbo-parser/src/gumbo.h
QGumboParser/gumbo-parser/src/insertion_mode.h
QGumboParser/gumbo-parser/src/parser.h
QGumboParser/gumbo-parser/src/string_buffer.h
QGumboParser/gumbo-parser/src/string_piece.h
QGumboParser/gumbo-parser/src/tag_enum.h
QGumboParser/gumbo-parser/src/tag_gperf.h
QGumboParser/gumbo-parser/src/tag_sizes.h
QGumboParser/gumbo-parser/src/tag_strings.h
QGumboParser/gumbo-parser/src/token_type.h
QGumboParser/gumbo-parser/src/tokenizer_states.h
QGumboParser/gumbo-parser/src/tokenizer.h
QGumboParser/gumbo-parser/src/utf8.h
QGumboParser/gumbo-parser/src/util.h
QGumboParser/gumbo-parser/src/vector.h
)
add_executable(buho
${buho_SRCS}
${buho_HDRS}
${buho_ASSETS}
${qgumbo_SRCS}
${qgumbo_HDRS}
)
if (ANDROID)
find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)
target_link_libraries(vvave Qt5::AndroidExtras)
kde_source_files_enable_exceptions(buho src/buho.cpp)
else()
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica)
find_package(Qt5 REQUIRED COMPONENTS WebEngine)
target_link_libraries(buho KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica)
endif()
if (TARGET create-apk-buho)
set_target_properties(create-apk-buho PROPERTIES ANDROID_APK_DIR "${MAUIKIT_ANDROID_DIR}")
endif()
target_link_libraries(buho MauiKit Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg)
install(TARGETS buho ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.buho.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
#TODO: port to ecm_install_icons()
install(FILES assets/buho.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps)
#install(FILES org.kde.buho.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/QGumboParser
${CMAKE_CURRENT_BINARY_DIR}/QGumboParser
)
set(qgumbo_SRCS
QGumboParser/qgumbodocument.cpp
QGumboParser/qgumbonode.cpp
QGumboParser/qgumboattribute.cpp
QGumboParser/gumbo-parser/src/attribute.c
QGumboParser/gumbo-parser/src/char_ref.c
QGumboParser/gumbo-parser/src/error.c
QGumboParser/gumbo-parser/src/parser.c
QGumboParser/gumbo-parser/src/string_buffer.c
QGumboParser/gumbo-parser/src/string_piece.c
QGumboParser/gumbo-parser/src/tag.c
QGumboParser/gumbo-parser/src/tokenizer.c
QGumboParser/gumbo-parser/src/utf8.c
QGumboParser/gumbo-parser/src/util.c
QGumboParser/gumbo-parser/src/vector.c
)
set(qgumbo_HDRS
QGumboParser/qgumboattribute.h
QGumboParser/qgumbodocument.h
QGumboParser/HtmlTag.h
QGumboParser/qgumbonode.h
QGumboParser/gumbo-parser/src/attribute.h
QGumboParser/gumbo-parser/src/char_ref.h
QGumboParser/gumbo-parser/src/char_ref.rl
QGumboParser/gumbo-parser/src/error.h
QGumboParser/gumbo-parser/src/gumbo.h
QGumboParser/gumbo-parser/src/insertion_mode.h
QGumboParser/gumbo-parser/src/parser.h
QGumboParser/gumbo-parser/src/string_buffer.h
QGumboParser/gumbo-parser/src/string_piece.h
QGumboParser/gumbo-parser/src/tag_enum.h
QGumboParser/gumbo-parser/src/tag_gperf.h
QGumboParser/gumbo-parser/src/tag_sizes.h
QGumboParser/gumbo-parser/src/tag_strings.h
QGumboParser/gumbo-parser/src/token_type.h
QGumboParser/gumbo-parser/src/tokenizer_states.h
QGumboParser/gumbo-parser/src/tokenizer.h
QGumboParser/gumbo-parser/src/utf8.h
QGumboParser/gumbo-parser/src/util.h
QGumboParser/gumbo-parser/src/vector.h
)
......@@ -17,15 +17,15 @@ Maui.ApplicationWindow
floatingBar: true
footBarOverlap: true
allowRiseContent: false
altToolBars: false
// altToolBars: false
/**** BRANDING COLORS ****/
menuButton.colorScheme.highlightColor: altColorText
searchButton.colorScheme.highlightColor: altColorText
colorSchemeName: "buho"
headBarBGColor: accentColor
headBarFGColor: altColorText
menuButton.colorScheme.highlightColor: accentColor
searchButton.colorScheme.highlightColor: accentColor
headBarBGColor: viewBackgroundColor
headBarFGColor: textColor
accentColor : "#ff9494"
// highlightColor: accentColor
altColorText : "white"/*Qt.darker(accentColor, 2.5)*/
......@@ -33,21 +33,21 @@ Maui.ApplicationWindow
about.appIcon: "qrc:/buho.svg"
property int currentView : views.notes
property var views : ({
notes: 0,
links: 1,
books: 2,
tags: 3,
search: 4
})
readonly property var views : ({
notes: 0,
links: 1,
books: 2,
tags: 3,
search: 4
})
property color headBarTint : Qt.lighter(headBarBGColor, 1.25)
headBar.middleContent: [
Maui.ToolButton
{
onClicked: currentView = views.notes
iconColor: currentView === views.notes? altColorText : headBarTint
colorScheme.highlightColor: altColorText
iconColor: currentView === views.notes? accentColor : textColor
colorScheme.highlightColor: accentColor
iconName: "view-notes"
text: qsTr("Notes")
},
......@@ -55,8 +55,8 @@ Maui.ApplicationWindow
Maui.ToolButton
{
onClicked: currentView = views.links
iconColor: currentView === views.links? altColorText : headBarTint
colorScheme.highlightColor: altColorText
iconColor: currentView === views.links? accentColor : textColor
colorScheme.highlightColor: accentColor
iconName: "view-links"
text: qsTr("Links")
},
......@@ -64,22 +64,24 @@ Maui.ApplicationWindow
Maui.ToolButton
{
onClicked: currentView = views.books
iconColor: currentView === views.books? altColorText : headBarTint
colorScheme.highlightColor: altColorText
iconColor: currentView === views.books? accentColor : textColor
colorScheme.highlightColor: accentColor
iconName: "view-books"
text: qsTr("Books")
},
Maui.ToolButton
{
iconColor: currentView === views.tags? altColorText : headBarTint
colorScheme.highlightColor: altColorText
iconColor: currentView === views.tags? accentColor : textColor
colorScheme.highlightColor: accentColor
iconName: "tag"
text: qsTr("Tags")
}
]
headBar.colorScheme.borderColor: Qt.darker(accentColor, 1.4)
// headBar.colorScheme.borderColor: Qt.darker(accentColor, 1.4)
headBar.drawBorder: false
headBar.implicitHeight: toolBarHeight * 1.5
footBar.colorScheme.backgroundColor: accentColor
footBar.colorScheme.borderColor: Qt.darker(accentColor, 1.4)
footBarMargins: space.huge
......@@ -187,6 +189,7 @@ Maui.ApplicationWindow
}
function newNote()
{
currentView = views.notes
......
......@@ -31,8 +31,6 @@ public slots:
bool update(const QVariantMap &data, const int &index) override;
bool update(const OWL::DB &note) override;
bool remove(const int &index) override;
};
#endif // NOTES_H
......@@ -82,7 +82,7 @@ Maui.Dialog
acceptText: qsTr("Save")
rejectText: qsTr("Discard")
colorScheme.backgroundColor: selectedColor
// colorScheme.backgroundColor: selectedColor
ColumnLayout
{
......
......@@ -25,18 +25,22 @@ Maui.Page
margins: space.big
headBarExit : false
headBar.drawBorder: false
headBar.visible: !cardsView.holder.visible
headBarTitle : cardsView.count + " notes"
headBar.leftContent: [
Maui.ToolButton
{
iconName: cardsView.gridView ? "view-list-icons" : "view-list-details"
iconName: cardsView.gridView ? "view-list-details" : "view-list-icons"
onClicked:
{
cardsView.gridView = !cardsView.gridView
}
},
}
]
headBar.rightContent: [
Maui.ToolButton
{
iconName: "view-sort"
......@@ -68,41 +72,43 @@ Maui.Page
Maui.MenuItem
{
text: qsTr("Title")
checkable: true
checked: notesList.sortBy === KEY.TITLE
onTriggered: notesList.sortBy = KEY.TITLE
}
Maui.MenuItem
{
text: qsTr("Color")
checkable: true
checked: notesList.sortBy === KEY.COLOR
onTriggered: notesList.sortBy = KEY.COLOR
}
Maui.MenuItem
{
text: qsTr("Add date")
checkable: true
checked: notesList.sortBy === KEY.ADD_DATE
onTriggered: notesList.sortBy = KEY.ADD_DATE
}
Maui.MenuItem
{
text: qsTr("Updated")
checkable: true
checked: notesList.sortBy === KEY.UPDATED
onTriggered: notesList.sortBy = KEY.UPDATED
}
Maui.MenuItem
{
text: qsTr("Fav")
checkable: true
checked: notesList.sortBy === KEY.FAV
onTriggered: notesList.sortBy = KEY.FAV
}
}
}
]
headBar.rightContent: [
Maui.ToolButton
{
iconName: "tag-recents"
},
Maui.ToolButton
{
......@@ -111,12 +117,6 @@ Maui.Page
checkable: true
iconColor: checked ? highlightColor : textColor
},
Maui.ToolButton
{
iconName: "view-calendar"
}
]
......
......@@ -5,6 +5,7 @@ import org.kde.mauikit 1.0 as Maui
Maui.Dialog
{
id: control
parent: parent
heightHint: 0.95
widthHint: 0.95
......@@ -12,13 +13,14 @@ Maui.Dialog
maxHeight: maxWidth
property string selectedColor : "#ffffe6"
property string fgColor: Qt.darker(selectedColor, 2.5)
property string fgColor: Qt.darker(selectedColor, 3)
property bool showEditActions : false
rejectButton.visible: false
signal noteSaved(var note)
page.margins: 0
colorScheme.backgroundColor: selectedColor
colorScheme.textColor: fgColor
headBar.leftContent: [
Maui.ToolButton
......@@ -27,7 +29,7 @@ Maui.Dialog
enabled: editor.body.canUndo
onClicked: editor.body.undo()
opacity: enabled ? 1 : 0.5
iconColor: control.colorScheme.textColor
},
Maui.ToolButton
......@@ -36,13 +38,14 @@ Maui.Dialog
enabled: editor.body.canRedo
onClicked: editor.body.redo()
opacity: enabled ? 1 : 0.5
iconColor: control.colorScheme.textColor
},
Maui.ToolButton
{
iconName: "format-text-bold"
focusPolicy: Qt.TabFocus
iconColor: checked ? highlightColor : textColor
iconColor: checked ? highlightColor : control.colorScheme.textColor
checkable: true
checked: editor.document.bold
onClicked: editor.document.bold = !editor.document.bold
......@@ -51,7 +54,7 @@ Maui.Dialog
Maui.ToolButton
{
iconName: "format-text-italic"
iconColor: checked ? highlightColor : textColor
iconColor: checked ? highlightColor : control.colorScheme.textColor
focusPolicy: Qt.TabFocus
checkable: true
checked: editor.document.italic
......@@ -61,7 +64,7 @@ Maui.Dialog
Maui.ToolButton
{
iconName: "format-text-underline"
iconColor: checked ? highlightColor : textColor
iconColor: checked ? highlightColor : control.colorScheme.textColor
focusPolicy: Qt.TabFocus
checkable: true
checked: editor.document.underline
......@@ -71,7 +74,7 @@ Maui.Dialog
Maui.ToolButton
{
iconName: "format-text-uppercase"
iconColor: checked ? highlightColor : textColor
iconColor: checked ? highlightColor : control.colorScheme.textColor
focusPolicy: Qt.TabFocus
checkable: true
checked: editor.document.uppercase
......@@ -80,6 +83,7 @@ Maui.Dialog
Maui.ToolButton
{
iconName: "image"
iconColor: control.colorScheme.textColor
}
]
......@@ -94,7 +98,7 @@ Maui.Dialog
id: pinButton
iconName: "edit-pin"
checkable: true
iconColor: checked ? highlightColor : textColor
iconColor: checked ? highlightColor : control.colorScheme.textColor
// onClicked: checked = !checked
},
......@@ -103,7 +107,7 @@ Maui.Dialog
id: favButton
iconName: "love"
checkable: true
iconColor: checked ? "#ff007f" : textColor
iconColor: checked ? "#ff007f" : control.colorScheme.textColor
},
Maui.ToolButton
......@@ -111,16 +115,22 @@ Maui.Dialog
iconName: "document-share"
onClicked: isAndroid ? Maui.Android.shareText(editor.body.text) :
shareDialog.show(editor.body.text)
iconColor: control.colorScheme.textColor
},
Maui.ToolButton
{
iconName: "document-export"
iconColor: control.colorScheme.textColor
},
Maui.ToolButton
{
iconName: "entry-delete"
iconColor: control.colorScheme.textColor
}
]
......@@ -164,6 +174,7 @@ Maui.Dialog
Layout.fillWidth: true
colorScheme.backgroundColor: selectedColor
headBar.visible: false
colorScheme.textColor: control.colorScheme.textColor
}
......@@ -176,6 +187,8 @@ Maui.Dialog
list.key: "notes"
onTagsEdited: list.updateToAbstract(tags)
onTagRemovedClicked: list.removeFromAbstract(index)
colorScheme.backgroundColor: "transparent"
colorScheme.textColor: control.colorScheme.textColor
}
}
......
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