From 580caf6f5c9b795f9c38b9c970efce12d006ce1d Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 17 Feb 2023 08:25:44 +0100 Subject: New UI design * Moved style definitions to its own file (themes/default) * Updated the desktop.kv to the new UI design * Removed planes * Adjusted port config --- .gitignore | 1 - tagit/__init__.py | 1 + tagit/actions/__init__.py | 5 - tagit/actions/action.kv | 15 -- tagit/actions/planes.kv | 15 -- tagit/actions/planes.py | 57 ------- tagit/apps/port-config.yaml | 79 +++++---- tagit/assets/icons/scalable/planes/browsing.svg | 157 ----------------- tagit/assets/icons/scalable/planes/codash.svg | 147 ---------------- tagit/assets/icons/scalable/planes/dashboard.svg | 142 ---------------- tagit/assets/themes/default/style.kv | 206 +++++++++++++++++++++++ tagit/dialogues/dialogue.kv | 63 ++----- tagit/dialogues/dialogue.py | 6 +- tagit/tiles/decoration.kv | 29 ++++ tagit/tiles/decoration.py | 9 + tagit/widgets/browser.kv | 23 +-- tagit/widgets/browser.py | 7 +- tagit/widgets/filter.kv | 59 +++---- tagit/widgets/status.kv | 16 +- tagit/windows/desktop.kv | 145 +++++++--------- tagit/windows/desktop.py | 35 ++-- 21 files changed, 411 insertions(+), 806 deletions(-) delete mode 100644 tagit/actions/planes.kv delete mode 100644 tagit/actions/planes.py delete mode 100644 tagit/assets/icons/scalable/planes/browsing.svg delete mode 100644 tagit/assets/icons/scalable/planes/codash.svg delete mode 100644 tagit/assets/icons/scalable/planes/dashboard.svg create mode 100644 tagit/assets/themes/default/style.kv diff --git a/.gitignore b/.gitignore index ba73cdf..4a3d2b0 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,6 @@ tagit/assets/icons/kivy/browser* tagit/assets/icons/kivy/filter* tagit/assets/icons/kivy/grouping* tagit/assets/icons/kivy/misc* -tagit/assets/icons/kivy/planes* tagit/assets/icons/kivy/search* tagit/assets/icons/kivy/session* tagit/assets/icons/kivy/tagging* diff --git a/tagit/__init__.py b/tagit/__init__.py index ec5f1c2..0e10d7b 100644 --- a/tagit/__init__.py +++ b/tagit/__init__.py @@ -40,6 +40,7 @@ kivy.require('1.9.1') # add resources resource_add_path(os.path.join(os.path.dirname(__file__), 'assets', 'icons', 'kivy')) resource_add_path(os.path.join(os.path.dirname(__file__), 'assets', 'fonts', 'kivy')) +resource_add_path(os.path.join(os.path.dirname(__file__), 'assets', 'themes')) # load font from kivy.core.text import LabelBase diff --git a/tagit/actions/__init__.py b/tagit/actions/__init__.py index b2ab6bd..bcd71c0 100644 --- a/tagit/actions/__init__.py +++ b/tagit/actions/__init__.py @@ -16,7 +16,6 @@ from . import filter from . import grouping from . import misc #from . import objects -from . import planes from . import search from . import session from . import tagging @@ -93,10 +92,6 @@ class ActionBuilder(BuilderBase): #'SetRank3': objects.SetRank3, #'SetRank4': objects.SetRank4, #'SetRank5': objects.SetRank5, - ## planes - 'ShowDashboard': planes.ShowDashboard, - 'ShowBrowsing': planes.ShowBrowsing, - 'ShowCodash': planes.ShowCodash, ## search 'Search': search.Search, 'ShowSelected': search.ShowSelected, diff --git a/tagit/actions/action.kv b/tagit/actions/action.kv index 5352964..807dd18 100644 --- a/tagit/actions/action.kv +++ b/tagit/actions/action.kv @@ -27,19 +27,4 @@ # to be disabled **after** show. show: [] - # decoration - canvas.before: - Color: - rgba: 17 / 255, 32 / 255, 148 / 255, self.selected_alpha - Rectangle: - pos: self.x, self.y + 1 - size: self.size - - canvas.after: - Color: - rgba: 17 / 255, 32 / 255, 148 / 255, self.selected_alpha - Line: - width: 2 - rectangle: self.x, self.y, self.width, self.height - ## EOF ## diff --git a/tagit/actions/planes.kv b/tagit/actions/planes.kv deleted file mode 100644 index 184f949..0000000 --- a/tagit/actions/planes.kv +++ /dev/null @@ -1,15 +0,0 @@ -#:import resource_find kivy.resources.resource_find - -: - source: resource_find('atlas://planes/dashboard') - tooltip: 'Switch to the Dashboard' - -: - source: resource_find('atlas://planes/browsing') - tooltip: 'Switch to the browsing plane' - -: - source: resource_find('atlas://planes/codash') - tooltip: 'Switch to the contextual dashboard' - -## EOF ## diff --git a/tagit/actions/planes.py b/tagit/actions/planes.py deleted file mode 100644 index 89f93bb..0000000 --- a/tagit/actions/planes.py +++ /dev/null @@ -1,57 +0,0 @@ -""" - -Part of the tagit module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" -# standard imports -import os - -# kivy imports -from kivy.lang import Builder -import kivy.properties as kp - -# inner-module imports -from .action import Action - -# exports -__all__ = [] - - -## code ## - -# load kv -Builder.load_file(os.path.join(os.path.dirname(__file__), 'planes.kv')) - -# classes - -class ShowDashboard(Action): - """Switch to the dashboard.""" - text = kp.StringProperty('Dashboard') - - def apply(self): - planes = self.root.planes - if planes.current_slide != planes.dashboard: - planes.load_slide(planes.dashboard) - - -class ShowBrowsing(Action): - """Switch to the browsing plane.""" - text = kp.StringProperty('Browsing') - - def apply(self): - planes = self.root.planes - if planes.current_slide != planes.browsing: - planes.load_slide(planes.browsing) - - -class ShowCodash(Action): - """Switch to the contextual dashboard.""" - text = kp.StringProperty('Context') - - def apply(self): - planes = self.root.planes - if planes.current_slide != planes.codash: - planes.load_slide(planes.codash) - -## EOF ## diff --git a/tagit/apps/port-config.yaml b/tagit/apps/port-config.yaml index a9907b7..323d616 100644 --- a/tagit/apps/port-config.yaml +++ b/tagit/apps/port-config.yaml @@ -7,9 +7,9 @@ session: backend: SparqlStore: {} user: 'http://example.com/me' - script: + script: [] #- ShowBrowsing - - [AddToken, 'hello'] + #- [AddToken, 'hello'] storage: index: preview_size: @@ -18,8 +18,11 @@ storage: - 400 ui: standalone: - plane: browsing + window_size: [1024, 768] + maximize: True keytriggers: + #- ClipboardCopy + #- ClipboardPaste - CreateGroup - DissolveGroup - AddToGroup @@ -55,17 +58,37 @@ ui: - OpenExternal - ShowHelp browser: + cols: 4 + rows: 3 maxcols: 8 maxrows: 8 + #gridmode: 'list' buttondocks: + navigation_left: + - MoveCursorFirst + - PreviousPage + - ScrollUp + navigation_right: + - NextPage + - ScrollDown + - MoveCursorLast + filter: + - GoBack + - GoForth + status: + - ZoomIn + - ZoomOut + #- RotateLeft + #- DeleteObject + #- RotateRight sidebar_left: - Menu - - ShowDashboard - - AddToken - AddTag - EditTag - - CreateGroup - - DissolveGroup + - ShowSelected + - RemoveSelected + #- CreateGroup + #- DissolveGroup - SelectAll - SelectNone - SelectInvert @@ -74,16 +97,13 @@ ui: - SelectSingle - SelectMulti - SelectRange - - ShellDrop - filter: - - AddToken - - EditToken context: app: - - ShowSettings + - LoadSession - ShowHelp - ShowConsole - - ShowBrowsing + - ShellDrop + - ShowSettings browser: - ZoomIn - ZoomOut @@ -96,11 +116,11 @@ ui: - AddToGroup # - RepresentGroup # - RemoveFromGroup - root: - - LoadSession - # search: - # - ShowSelected - # - RemoveSelected + search: + - ShowSelected + - RemoveSelected + - GoForth + - GoBack select: - SelectAll - SelectNone @@ -127,28 +147,5 @@ ui: - camera - attributes tiledocks: - dashboard: {} - #Buttons: - # buttons: - # - ShowBrowsing - # - CreateSession - # - CreateTempSession - # - LoadSession - # - ReloadSession - # - ImportObjects - # - ItemExport - # - UpdateSelectedObjects - # - ShowHelp - # - ShowSettings - #Hints: {} - #LibSummary: {} - #Searchtree: {} - #TagHistogram: {} - #Tagcloud: {} sidebar_right: Info: {} - CursorTags: {} - BrowserTags: {} - #SelectionTags: {} - #Geo: {} - window_size: 1024x768 diff --git a/tagit/assets/icons/scalable/planes/browsing.svg b/tagit/assets/icons/scalable/planes/browsing.svg deleted file mode 100644 index f502c36..0000000 --- a/tagit/assets/icons/scalable/planes/browsing.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff --git a/tagit/assets/icons/scalable/planes/codash.svg b/tagit/assets/icons/scalable/planes/codash.svg deleted file mode 100644 index b25c2b0..0000000 --- a/tagit/assets/icons/scalable/planes/codash.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - c - - diff --git a/tagit/assets/icons/scalable/planes/dashboard.svg b/tagit/assets/icons/scalable/planes/dashboard.svg deleted file mode 100644 index 6f7e4a3..0000000 --- a/tagit/assets/icons/scalable/planes/dashboard.svg +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff --git a/tagit/assets/themes/default/style.kv b/tagit/assets/themes/default/style.kv new file mode 100644 index 0000000..a3f9cd1 --- /dev/null +++ b/tagit/assets/themes/default/style.kv @@ -0,0 +1,206 @@ + +# DEBUG: Draw borders around all widgets +#: +# canvas.after: +# Line: +# rectangle: self.x+1,self.y+1,self.width-1,self.height-1 +# dash_offset: 5 +# dash_length: 3 + +# color definitions +#:set colors_background [0x1c/256, 0x1b/256, 0x22/256] # dark grey +#:set colors_text [0xc5/256, 0xc9/256, 0xc7/256] # silver +#:set colors_highlight [0xb5/256, 0x94/256, 0x10/256] # darkgold + +# generic styles + +