diff --git a/designer/data/icons/error.png b/designer/assets/icons/error.png similarity index 100% rename from designer/data/icons/error.png rename to designer/assets/icons/error.png diff --git a/designer/assets/icons/icon.png b/designer/assets/icons/icon.png new file mode 100644 index 0000000..0971974 Binary files /dev/null and b/designer/assets/icons/icon.png differ diff --git a/designer/data/icons/info.png b/designer/assets/icons/info.png similarity index 100% rename from designer/data/icons/info.png rename to designer/assets/icons/info.png diff --git a/designer/assets/icons/kivy-icon-256.png b/designer/assets/icons/kivy-icon-256.png new file mode 100644 index 0000000..7d1bb0d Binary files /dev/null and b/designer/assets/icons/kivy-icon-256.png differ diff --git a/designer/assets/icons/kivy-icon-512.png b/designer/assets/icons/kivy-icon-512.png new file mode 100644 index 0000000..b0add83 Binary files /dev/null and b/designer/assets/icons/kivy-icon-512.png differ diff --git a/designer/assets/icons/kivy-icon-64.png b/designer/assets/icons/kivy-icon-64.png new file mode 100644 index 0000000..5ae7381 Binary files /dev/null and b/designer/assets/icons/kivy-icon-64.png differ diff --git a/designer/data/icons/loading.gif b/designer/assets/icons/loading.gif similarity index 100% rename from designer/data/icons/loading.gif rename to designer/assets/icons/loading.gif diff --git a/designer/assets/icons/logo.png b/designer/assets/icons/logo.png new file mode 100644 index 0000000..8e55330 Binary files /dev/null and b/designer/assets/icons/logo.png differ diff --git a/designer/assets/icons/ouya_icon.png b/designer/assets/icons/ouya_icon.png new file mode 100644 index 0000000..dda1ec6 Binary files /dev/null and b/designer/assets/icons/ouya_icon.png differ diff --git a/designer/data/new_templates/images/actionbar.png b/designer/assets/template_images/actionbar.png similarity index 100% rename from designer/data/new_templates/images/actionbar.png rename to designer/assets/template_images/actionbar.png diff --git a/designer/data/new_templates/images/boxlayout.png b/designer/assets/template_images/boxlayout.png similarity index 100% rename from designer/data/new_templates/images/boxlayout.png rename to designer/assets/template_images/boxlayout.png diff --git a/designer/data/new_templates/images/carousel_actionbar.png b/designer/assets/template_images/carousel_actionbar.png similarity index 100% rename from designer/data/new_templates/images/carousel_actionbar.png rename to designer/assets/template_images/carousel_actionbar.png diff --git a/designer/data/new_templates/images/floatlayout.png b/designer/assets/template_images/floatlayout.png similarity index 100% rename from designer/data/new_templates/images/floatlayout.png rename to designer/assets/template_images/floatlayout.png diff --git a/designer/data/new_templates/images/screenmanager.png b/designer/assets/template_images/screenmanager.png similarity index 100% rename from designer/data/new_templates/images/screenmanager.png rename to designer/assets/template_images/screenmanager.png diff --git a/designer/data/new_templates/images/screenmanager_actionbar.png b/designer/assets/template_images/screenmanager_actionbar.png similarity index 100% rename from designer/data/new_templates/images/screenmanager_actionbar.png rename to designer/assets/template_images/screenmanager_actionbar.png diff --git a/designer/data/new_templates/images/tabbedpanel.png b/designer/assets/template_images/tabbedpanel.png similarity index 100% rename from designer/data/new_templates/images/tabbedpanel.png rename to designer/assets/template_images/tabbedpanel.png diff --git a/designer/data/new_templates/images/textinput_scrollview.png b/designer/assets/template_images/textinput_scrollview.png similarity index 100% rename from designer/data/new_templates/images/textinput_scrollview.png rename to designer/assets/template_images/textinput_scrollview.png diff --git a/designer/components/buildozer_spec_editor.py b/designer/components/buildozer_spec_editor.py index f40c0f3..c48b321 100644 --- a/designer/components/buildozer_spec_editor.py +++ b/designer/components/buildozer_spec_editor.py @@ -18,6 +18,8 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + : do_scroll_x: False container: content @@ -64,8 +66,8 @@ size_hint_y: None height: '25pt' Button: - background_normal: 'atlas://data/images/defaulttheme/action_item' - background_down: 'atlas://data/images/defaulttheme/action_item' + background_normal: theme_atlas('action_item') + background_down: theme_atlas('action_item') text: 'GUI editor to buildozer.spec.z\\nRead more at http://buildozer.readthedocs.org' text_size: self.size font_size: '11pt' diff --git a/designer/components/designer_content.py b/designer/components/designer_content.py index 2d74c2f..e379e7d 100644 --- a/designer/components/designer_content.py +++ b/designer/components/designer_content.py @@ -22,6 +22,8 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + : ui_creator: ui_creator tree_view: tree_view @@ -104,7 +106,7 @@ orientation: 'vertical' width: 22 Image: - source: 'atlas://data/images/defaulttheme/close' + source: theme_atlas('close') on_touch_down: if self.collide_point(*args[1].pos) : root.dispatch('on_close') diff --git a/designer/components/dialogs/about.py b/designer/components/dialogs/about.py index 9b835d2..5934f41 100644 --- a/designer/components/dialogs/about.py +++ b/designer/components/dialogs/about.py @@ -3,9 +3,11 @@ Builder.load_string(""" +#: import icons utils.utils.icons + : Image: - source: 'data/logo/kivy-icon-512.png' + source: icons('kivy-icon-512') pos: root.pos opacity: 0.2 BoxLayout: diff --git a/designer/components/dialogs/new_project.py b/designer/components/dialogs/new_project.py index bae5607..d893154 100644 --- a/designer/components/dialogs/new_project.py +++ b/designer/components/dialogs/new_project.py @@ -1,9 +1,7 @@ from functools import partial -from os.path import join from kivy.uix.scrollview import ScrollView -from utils.utils import constants -from utils.utils import get_kd_data_dir +from utils.utils import template_images from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.uix.boxlayout import BoxLayout @@ -11,23 +9,22 @@ NEW_PROJECTS = { - 'FloatLayout': ('template_floatlayout_kv', - 'template_floatlayout_py'), - 'BoxLayout': ('template_boxlayout_kv', - 'template_boxlayout_py'), - 'ScreenManager': ('template_screen_manager_kv', - 'template_screen_manager_py'), - 'ActionBar': ('template_actionbar_kv', - 'template_actionbar_py'), - 'Carousel and ActionBar': ('template_actionbar_carousel_kv', - 'template_actionbar_carousel_py'), - 'ScreenManager and ActionBar': ('template_screen_manager_actionbar_kv', - 'template_screen_manager_actionbar_py'), - 'TabbedPanel': ('template_tabbed_panel_kv', - 'template_tabbed_panel_py'), - 'TextInput and ScrollView': ('template_textinput_scrollview_kv', - 'template_textinput_scrollview_py')} - + 'FloatLayout': ('template_floatlayout_kv', 'template_floatlayout_py'), + + 'BoxLayout': ('template_boxlayout_kv', 'template_boxlayout_py'), + + 'ScreenManager': ('template_screen_manager_kv', 'template_screen_manager_py'), + + 'ActionBar': ('template_actionbar_kv', 'template_actionbar_py'), + + 'Carousel and ActionBar': ('template_actionbar_carousel_kv', 'template_actionbar_carousel_py'), + + 'ScreenManager and ActionBar': ('template_screen_manager_actionbar_kv', 'template_screen_manager_actionbar_py'), + + 'TabbedPanel': ('template_tabbed_panel_kv', 'template_tabbed_panel_py'), + + 'TextInput and ScrollView': ('template_textinput_scrollview_kv', 'template_textinput_scrollview_py') +} Builder.load_string(""" @@ -220,10 +217,9 @@ def __init__(self, **kwargs): def update_template_preview(self, instance): '''Event handler for 'on_selection_change' event of adapter. ''' - name = instance.text.lower() + '.png' + name = instance.text.lower() name = name.replace(' and ', '_') - image_source = join(get_kd_data_dir(), - constants.NEW_TEMPLATE_IMAGE_PATH, name) + image_source = template_images(name) self.template_preview.source = image_source def on_app_name_text(self, instance, value): diff --git a/designer/components/property_viewer.py b/designer/components/property_viewer.py index 2690fbc..7ea0f97 100644 --- a/designer/components/property_viewer.py +++ b/designer/components/property_viewer.py @@ -16,13 +16,15 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + : valign: 'middle' halign: 'left' shorten: True shorten_from: 'right' Image: - source: 'atlas://data/images/defaulttheme/tree_opened' + source: theme_atlas('tree_opened') size_hint: None, None size: root.height, root.height pos: root.x + root.width - root.height, root.y diff --git a/designer/components/start_page.py b/designer/components/start_page.py index fdaf76d..99c75cf 100644 --- a/designer/components/start_page.py +++ b/designer/components/start_page.py @@ -8,6 +8,8 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + size_hint_x: None width: self.texture_size[0] + sp(32) @@ -105,8 +107,8 @@ : color: 0, 0, 1, 1 - background_normal: 'atlas://data/images/defaulttheme/action_item' - background_disabled_normal: 'atlas://data/images/defaulttheme/action_item_disabled' + background_normal: theme_atlas('action_item') + background_disabled_normal: theme_atlas('action_item_disabled') text_size: self.width, None : diff --git a/designer/components/statusbar.py b/designer/components/statusbar.py index 1ae2d8f..807620d 100644 --- a/designer/components/statusbar.py +++ b/designer/components/statusbar.py @@ -4,6 +4,7 @@ from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.label import Label +from utils.utils import icons from kivy.uix.tabbedpanel import ( TabbedPanel, TabbedPanelContent, TabbedPanelHeader, ) @@ -133,11 +134,11 @@ def show_message(self, message, duration=5, notification_type=None): self.message = message icon = '' if notification_type == 'info': - icon = 'icons/info.png' + icon = icons('info') elif notification_type == 'error': - icon = 'icons/error.png' + icon = icons('error') elif notification_type == 'loading': - icon = 'icons/loading.gif' + icon = icons('loading', '.gif') if icon: self.img.opacity = 1 diff --git a/designer/core/profile_settings.py b/designer/core/profile_settings.py index 37053c4..025d30e 100644 --- a/designer/core/profile_settings.py +++ b/designer/core/profile_settings.py @@ -3,8 +3,7 @@ import shutil from uix.confirmation_dialog import ConfirmationDialog -from utils.utils import constants -from utils.utils import get_config_dir, get_kd_data_dir +from utils.utils import get_config_dir, get_kd_data_dir, profiles_path from kivy.config import ConfigParser from kivy.properties import DictProperty, ObjectProperty from kivy.uix.popup import Popup @@ -209,12 +208,9 @@ def load_profiles(self): '''This function loads project settings ''' self.settings_changed = False - self.PROFILES_PATH = os.path.join(get_config_dir(), - constants.DIR_PROFILES) - - self.DEFAULT_PROFILES = os.path.join(get_kd_data_dir(), - constants.DIR_PROFILES) - + self.PROFILES_PATH = os.path.join(get_config_dir(), 'profiles') + self.DEFAULT_PROFILES = profiles_path() + if not os.path.exists(self.PROFILES_PATH): shutil.copytree(self.DEFAULT_PROFILES, self.PROFILES_PATH) @@ -236,18 +232,12 @@ def update_panel(self): str(prof_name) + '_' + _file_path] = config_parser for _file in sorted(self.config_parsers): - prof_name = self.config_parsers[_file].getdefault('profile', - 'name', - 'PROFILE') + prof_name = self.config_parsers[_file].getdefault('profile', 'name', 'PROFILE') if not prof_name.strip(): prof_name = 'PROFILE' - self.add_json_panel(prof_name, - self.config_parsers[_file], - os.path.join( - get_kd_data_dir(), - 'settings', - 'build_profile.json') - ) + + path_sett = os.path.join(get_kd_data_dir(), 'settings', 'build_profile.json') + self.add_json_panel(prof_name, self.config_parsers[_file], path_sett) # force to show the first profile first_panel = self.interface.menu.buttons_layout.children[-1].uid diff --git a/designer/core/project_settings.py b/designer/core/project_settings.py index b726d64..6267bfd 100644 --- a/designer/core/project_settings.py +++ b/designer/core/project_settings.py @@ -1,14 +1,12 @@ import os -from utils.utils import get_kd_data_dir, ignore_proj_watcher +from utils.utils import get_kd_data_dir, ignore_proj_watcher, profiles_path from kivy.config import ConfigParser from kivy.properties import ObjectProperty from kivy.uix.settings import Settings - PROJ_DESIGNER = '.designer' -PROJ_CONFIG = os.path.join(PROJ_DESIGNER, 'config.ini') - +PROJ_CONFIG = profiles_path('config') class ProjectSettings(Settings): '''Subclass of :class:`kivy.uix.settings.Settings` responsible for diff --git a/designer/core/settings.py b/designer/core/settings.py index 73515c3..f5e7075 100644 --- a/designer/core/settings.py +++ b/designer/core/settings.py @@ -1,18 +1,16 @@ -from multiprocessing.sharedctypes import Value import os import os.path import shutil import sys from distutils.spawn import find_executable -from utils.utils import get_config_dir, get_kd_data_dir, get_kd_dir, constants from uix.settings import SettingList, SettingShortcut +from utils.utils import get_config_dir, get_kd_data_dir, config_path from kivy.config import ConfigParser from kivy.properties import ObjectProperty from kivy.uix.settings import Settings from pygments import styles - # monkey backport! (https://github.com/kivy/kivy/pull/2288) if not hasattr(ConfigParser, 'upgrade'): from configparser import RawConfigParser as PythonConfigParser @@ -51,12 +49,11 @@ def load_settings(self): self.config_parser = ConfigParser(name='DesignerSettings') except Exception: return False - - DESIGNER_CONFIG = os.path.join(get_config_dir(), - constants.DESIGNER_CONFIG_FILE_NAME) + + DESIGNER_CONFIG = os.path.join(get_config_dir(), 'config.ini') + + DEFAULT_CONFIG = config_path('config') - DEFAULT_CONFIG = os.path.join(get_kd_dir(), - constants.DESIGNER_CONFIG_FILE_NAME) if not os.path.exists(DESIGNER_CONFIG): shutil.copyfile(DEFAULT_CONFIG, DESIGNER_CONFIG) diff --git a/designer/data/new_templates/default.spec b/designer/data/new_templates/default.spec deleted file mode 100644 index d084dab..0000000 --- a/designer/data/new_templates/default.spec +++ /dev/null @@ -1,233 +0,0 @@ -[app] - -# (str) Title of your application -title = $app_name - -# (str) Package name -package.name = $package_name - -# (str) Package domain (needed for android/ios packaging) -package.domain = $package_domain - -# (str) Source code where the main.py live -source.dir = . - -# (list) Source files to include (let empty to include all the files) -source.include_exts = py,png,jpg,kv,atlas - -# (list) List of inclusions using pattern matching -#source.include_patterns = assets/*,images/*.png - -# (list) Source files to exclude (let empty to not exclude anything) -#source.exclude_exts = spec - -# (list) List of directory to exclude (let empty to not exclude anything) -#source.exclude_dirs = tests, bin - -# (list) List of exclusions using pattern matching -#source.exclude_patterns = license,images/*/*.jpg - -# (str) Application versioning (method 1) -version = $package_version - -# (str) Application versioning (method 2) -# version.regex = __version__ = ['"](.*)['"] -# version.filename = %(source.dir)s/main.py - -# (list) Application requirements -# comma seperated e.g. requirements = sqlite3,kivy -requirements = kivy - -# (str) Custom source folders for requirements -# Sets custom source for any requirements with recipes -# requirements.source.kivy = ../../kivy - -# (list) Garden requirements -#garden_requirements = - -# (str) Presplash of the application -#presplash.filename = %(source.dir)s/data/presplash.png - -# (str) Icon of the application -#icon.filename = %(source.dir)s/data/icon.png - -# (str) Supported orientation (one of landscape, portrait or all) -orientation = landscape - -# (list) List of service to declare -#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY - -# -# OSX Specific -# - -# -# author = © Copyright Info - -# -# Android specific -# - -# (bool) Indicate if the application should be fullscreen or not -fullscreen = 1 - -# (list) Permissions -#android.permissions = INTERNET - -# (int) Android API to use -#android.api = 19 - -# (int) Minimum API required -#android.minapi = 9 - -# (int) Android SDK version to use -#android.sdk = 21 - -# (str) Android NDK version to use -#android.ndk = 9c - -# (bool) Use --private data storage (True) or --dir public storage (False) -#android.private_storage = True - -# (str) Android NDK directory (if empty, it will be automatically downloaded.) -#android.ndk_path = - -# (str) Android SDK directory (if empty, it will be automatically downloaded.) -#android.sdk_path = - -# (str) ANT directory (if empty, it will be automatically downloaded.) -#android.ant_path = - -# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) -#android.p4a_dir = - -# (str) The directory in which python-for-android should look for your own build recipes (if any) -#p4a.local_recipes =q - -# (list) python-for-android whitelist -#android.p4a_whitelist = - -# (bool) If True, then skip trying to update the Android sdk -# This can be useful to avoid excess Internet downloads or save time -# when an update is due and you just want to test/build your package -# android.skip_update = False - -# (str) Bootstrap to use for android builds (android_new only) -# android.bootstrap = sdl2 - -# (str) Android entry point, default is ok for Kivy-based app -#android.entrypoint = org.renpy.android.PythonActivity - -# (list) List of Java .jar files to add to the libs so that pyjnius can access -# their classes. Don't add jars that you do not need, since extra jars can slow -# down the build process. Allows wildcards matching, for example: -# OUYA-ODK/libs/*.jar -#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar - -# (list) List of Java files to add to the android project (can be java or a -# directory containing the files) -#android.add_src = - -# (str) python-for-android branch to use, if not master, useful to try -# not yet merged features. -#android.branch = master - -# (str) OUYA Console category. Should be one of GAME or APP -# If you leave this blank, OUYA support will not be enabled -#android.ouya.category = GAME - -# (str) Filename of OUYA Console icon. It must be a 732x412 png image. -#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png - -# (str) XML file to include as an intent filters in tag -#android.manifest.intent_filters = - -# (list) Android additionnal libraries to copy into libs/armeabi -#android.add_libs_armeabi = libs/android/*.so -#android.add_libs_armeabi_v7a = libs/android-v7/*.so -#android.add_libs_x86 = libs/android-x86/*.so -#android.add_libs_mips = libs/android-mips/*.so - -# (bool) Indicate whether the screen should stay on -# Don't forget to add the WAKE_LOCK permission if you set this to True -#android.wakelock = False - -# (list) Android application meta-data to set (key=value format) -#android.meta_data = - -# (list) Android library project to add (will be added in the -# project.properties automatically.) -#android.library_references = - -# (str) Android logcat filters to use -#android.logcat_filters = *:S python:D - -# (bool) Copy library instead of making a libpymodules.so -#android.copy_libs = 1 - -# -# iOS specific -# - -# (str) Path to a custom kivy-ios folder -#ios.kivy_ios_dir = ../kivy-ios - -# (str) Name of the certificate to use for signing the debug version -# Get a list of available identities: buildozer ios list_identities -#ios.codesign.debug = "iPhone Developer: ()" - -# (str) Name of the certificate to use for signing the release version -#ios.codesign.release = %(ios.codesign.debug)s - - -[buildozer] - -# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) -log_level = 1 - -# (int) Display warning if buildozer is run as root (0 = False, 1 = True) -warn_on_root = 1 - -# (str) Path to build artifact storage, absolute or relative to spec file -# build_dir = ./.buildozer - -# (str) Path to build output (i.e. .apk, .ipa) storage -# bin_dir = ./bin - -# ----------------------------------------------------------------------------- -# List as sections -# -# You can define all the "list" as [section:key]. -# Each line will be considered as a option to the list. -# Let's take [app] / source.exclude_patterns. -# Instead of doing: -# -#[app] -#source.exclude_patterns = license,data/audio/*.wav,data/images/original/* -# -# This can be translated into: -# -#[app:source.exclude_patterns] -#license -#data/audio/*.wav -#data/images/original/* -# - - -# ----------------------------------------------------------------------------- -# Profiles -# -# You can extend section / key with a profile -# For example, you want to deploy a demo version of your application without -# HD content. You could first change the title to add "(demo)" in the name -# and extend the excluded directories to remove the HD content. -# -#[app@demo] -#title = My Application (demo) -# -#[app:source.exclude_patterns@demo] -#images/hd/* -# -# Then, invoke the command line with the "demo" profile: -# -#buildozer --profile demo android debug diff --git a/designer/screens/inicial/main_inicial.py b/designer/screens/inicial/main_inicial.py index fa9dc5f..5f6d90a 100644 --- a/designer/screens/inicial/main_inicial.py +++ b/designer/screens/inicial/main_inicial.py @@ -19,7 +19,7 @@ from utils.utils import ( ignore_proj_watcher, get_kd_data_dir, show_message, get_kd_dir, get_path, - utils_source_rst, + utils_source_rst, template_file, ) from tempfile import mkdtemp from distutils.dir_util import copy_tree @@ -541,16 +541,14 @@ def _perform_new(self, *args): package_version = self._new_dialog.package_version.text templates_dir = os.path.join(get_kd_data_dir(), constants.DIR_NEW_TEMPLATE) - kv_file = NEW_PROJECTS[template][0] - py_file = NEW_PROJECTS[template][1] + kv_file = template_file(NEW_PROJECTS[template][0]) + py_file = template_file(NEW_PROJECTS[template][1]) - shutil.copy(os.path.join(templates_dir, py_file), - os.path.join(new_proj_dir, "main.py")) - shutil.copy(os.path.join(templates_dir, kv_file), - os.path.join(new_proj_dir, "main.kv")) + shutil.copy(py_file, os.path.join(new_proj_dir, "main.py")) + shutil.copy(kv_file, os.path.join(new_proj_dir, "main.kv")) buildozer = io.open(os.path.join(new_proj_dir, 'buildozer.spec'), 'w', encoding='utf-8') - for line in io.open(os.path.join(templates_dir, 'default.spec'), 'r', encoding='utf-8'): + for line in io.open(template_file('default.spec'), 'r', encoding='utf-8'): line = line.replace('$app_name', app_name) line = line.replace('$package_name', package_name) line = line.replace('$package_domain', package_domain) diff --git a/designer/tools/bug_reporter.py b/designer/tools/bug_reporter.py index abb4d22..d99d5e7 100644 --- a/designer/tools/bug_reporter.py +++ b/designer/tools/bug_reporter.py @@ -21,10 +21,12 @@ Builder.load_string(''' +#: import icons utils.utils.icons + : txt_traceback: txt_traceback Image: - source: 'data/logo/kivy-icon-256.png' + source: icons('kivy-icon-256') opacity: 0.2 BoxLayout: orientation: 'vertical' diff --git a/designer/data/profiles/android_buildozer.ini b/designer/tools/profiles/android_buildozer.ini similarity index 100% rename from designer/data/profiles/android_buildozer.ini rename to designer/tools/profiles/android_buildozer.ini diff --git a/designer/config.ini b/designer/tools/profiles/config.ini similarity index 92% rename from designer/config.ini rename to designer/tools/profiles/config.ini index 3982e3e..3b70589 100644 --- a/designer/config.ini +++ b/designer/tools/profiles/config.ini @@ -6,10 +6,10 @@ auto_save_time = 5 code_input_theme = emacs [buildozer] -buildozer_path = +buildozer_path = [hanga] -hanga_api_key = +hanga_api_key = [desktop] save_window_size = 1 @@ -18,10 +18,10 @@ exit_on_escape = 0 [internal] window_width = 800 window_height = 600 -default_profile = +default_profile = mod_screen_scale = 1.0 mod_screen_orientation = portrait -mod_screen_device = +mod_screen_device = [view] actn_chk_proj_tree = True @@ -55,4 +55,5 @@ help = [] + f1 kivy_docs = ['ctrl'] + f1 kd_docs = ['ctrl', 'shift'] + f1 kd_repo = ['ctrl'] + r -about = [] + f10 \ No newline at end of file +about = [] + f10 + diff --git a/designer/data/profiles/desktop.ini b/designer/tools/profiles/desktop.ini similarity index 100% rename from designer/data/profiles/desktop.ini rename to designer/tools/profiles/desktop.ini diff --git a/designer/data/profiles/ios_buildozer.ini b/designer/tools/profiles/ios_buildozer.ini similarity index 100% rename from designer/data/profiles/ios_buildozer.ini rename to designer/tools/profiles/ios_buildozer.ini diff --git a/designer/data/settings/build_profile.json b/designer/tools/settings/build_profile.json similarity index 100% rename from designer/data/settings/build_profile.json rename to designer/tools/settings/build_profile.json diff --git a/designer/data/settings/buildozer_settings.json b/designer/tools/settings/buildozer_settings.json similarity index 100% rename from designer/data/settings/buildozer_settings.json rename to designer/tools/settings/buildozer_settings.json diff --git a/designer/data/settings/buildozer_spec_android.json b/designer/tools/settings/buildozer_spec_android.json similarity index 62% rename from designer/data/settings/buildozer_spec_android.json rename to designer/tools/settings/buildozer_spec_android.json index 91447fe..18765b6 100644 --- a/designer/data/settings/buildozer_spec_android.json +++ b/designer/tools/settings/buildozer_spec_android.json @@ -9,7 +9,160 @@ "section": "app", "desc": "Application required permissions.", "key": "android.permissions", - "items": ["ACCESS_CHECKIN_PROPERTIES", "ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION", "ACCESS_LOCATION_EXTRA_COMMANDS", "ACCESS_MOCK_LOCATION", "ACCESS_NETWORK_STATE", "ACCESS_SURFACE_FLINGER", "ACCESS_WIFI_STATE", "ACCOUNT_MANAGER", "ADD_VOICEMAIL", "AUTHENTICATE_ACCOUNTS", "BATTERY_STATS", "BIND_ACCESSIBILITY_SERVICE", "BIND_APPWIDGET", "BIND_CARRIER_MESSAGING_SERVICE", "BIND_DEVICE_ADMIN", "BIND_DREAM_SERVICE", "BIND_INPUT_METHOD", "BIND_NFC_SERVICE", "BIND_NOTIFICATION_LISTENER_SERVICE", "BIND_PRINT_SERVICE", "BIND_REMOTEVIEWS", "BIND_TEXT_SERVICE", "BIND_TV_INPUT", "BIND_VOICE_INTERACTION", "BIND_VPN_SERVICE", "BIND_WALLPAPER", "BLUETOOTH", "BLUETOOTH_ADMIN", "BLUETOOTH_PRIVILEGED", "BODY_SENSORS", "BRICK", "BROADCAST_PACKAGE_REMOVED", "BROADCAST_SMS", "BROADCAST_STICKY", "BROADCAST_WAP_PUSH", "CALL_PHONE", "CALL_PRIVILEGED", "CAMERA", "CAPTURE_AUDIO_OUTPUT", "CAPTURE_SECURE_VIDEO_OUTPUT", "CAPTURE_VIDEO_OUTPUT", "CHANGE_COMPONENT_ENABLED_STATE", "CHANGE_CONFIGURATION", "CHANGE_NETWORK_STATE", "CHANGE_WIFI_MULTICAST_STATE", "CHANGE_WIFI_STATE", "CLEAR_APP_CACHE", "CLEAR_APP_USER_DATA", "CONTROL_LOCATION_UPDATES", "DELETE_CACHE_FILES", "DELETE_PACKAGES", "DEVICE_POWER", "DIAGNOSTIC", "DISABLE_KEYGUARD", "DUMP", "EXPAND_STATUS_BAR", "FACTORY_TEST", "FLASHLIGHT", "FORCE_BACK", "GET_ACCOUNTS", "GET_PACKAGE_SIZE", "GET_TASKS", "GET_TOP_ACTIVITY_INFO", "GLOBAL_SEARCH", "HARDWARE_TEST", "INJECT_EVENTS", "INSTALL_LOCATION_PROVIDER", "INSTALL_PACKAGES", "INSTALL_SHORTCUT", "INTERNAL_SYSTEM_WINDOW", "INTERNET", "KILL_BACKGROUND_PROCESSES", "LOCATION_HARDWARE", "MANAGE_ACCOUNTS", "MANAGE_APP_TOKENS", "MANAGE_DOCUMENTS", "MASTER_CLEAR", "MEDIA_CONTENT_CONTROL", "MODIFY_AUDIO_SETTINGS", "MODIFY_PHONE_STATE", "MOUNT_FORMAT_FILESYSTEMS", "MOUNT_UNMOUNT_FILESYSTEMS", "NFC", "PERSISTENT_ACTIVITY", "PROCESS_OUTGOING_CALLS", "READ_CALENDAR", "READ_CALL_LOG", "READ_CONTACTS", "READ_EXTERNAL_STORAGE", "READ_FRAME_BUFFER", "READ_HISTORY_BOOKMARKS", "READ_INPUT_STATE", "READ_LOGS", "READ_PHONE_STATE", "READ_PROFILE", "READ_SMS", "READ_SOCIAL_STREAM", "READ_SYNC_SETTINGS", "READ_SYNC_STATS", "READ_USER_DICTIONARY", "READ_VOICEMAIL", "REBOOT", "RECEIVE_BOOT_COMPLETED", "RECEIVE_MMS", "RECEIVE_SMS", "RECEIVE_WAP_PUSH", "RECORD_AUDIO", "REORDER_TASKS", "RESTART_PACKAGES", "SEND_RESPOND_VIA_MESSAGE", "SEND_SMS", "SET_ACTIVITY_WATCHER", "SET_ALARM", "SET_ALWAYS_FINISH", "SET_ANIMATION_SCALE", "SET_DEBUG_APP", "SET_ORIENTATION", "SET_POINTER_SPEED", "SET_PREFERRED_APPLICATIONS", "SET_PROCESS_LIMIT", "SET_TIME", "SET_TIME_ZONE", "SET_WALLPAPER", "SET_WALLPAPER_HINTS", "SIGNAL_PERSISTENT_PROCESSES", "STATUS_BAR", "SUBSCRIBED_FEEDS_READ", "SUBSCRIBED_FEEDS_WRITE", "SYSTEM_ALERT_WINDOW", "TRANSMIT_IR", "UNINSTALL_SHORTCUT", "UPDATE_DEVICE_STATS", "USE_CREDENTIALS", "USE_SIP", "VIBRATE", "WAKE_LOCK", "WRITE_APN_SETTINGS", "WRITE_CALENDAR", "WRITE_CALL_LOG", "WRITE_CONTACTS", "WRITE_EXTERNAL_STORAGE", "WRITE_GSERVICES", "WRITE_HISTORY_BOOKMARKS", "WRITE_PROFILE", "WRITE_SECURE_SETTINGS", "WRITE_SETTINGS", "WRITE_SMS", "WRITE_SOCIAL_STREAM", "WRITE_SYNC_SETTINGS", "WRITE_USER_DICTIONARY", "WRITE_VOICEMAIL"] + "items": [ + "ACCESS_CHECKIN_PROPERTIES", + "ACCESS_COARSE_LOCATION", + "ACCESS_FINE_LOCATION", + "ACCESS_LOCATION_EXTRA_COMMANDS", + "ACCESS_MOCK_LOCATION", + "ACCESS_NETWORK_STATE", + "ACCESS_SURFACE_FLINGER", + "ACCESS_WIFI_STATE", + "ACCOUNT_MANAGER", + "ADD_VOICEMAIL", + "AUTHENTICATE_ACCOUNTS", + "BATTERY_STATS", + "BIND_ACCESSIBILITY_SERVICE", + "BIND_APPWIDGET", + "BIND_CARRIER_MESSAGING_SERVICE", + "BIND_DEVICE_ADMIN", + "BIND_DREAM_SERVICE", + "BIND_INPUT_METHOD", + "BIND_NFC_SERVICE", + "BIND_NOTIFICATION_LISTENER_SERVICE", + "BIND_PRINT_SERVICE", + "BIND_REMOTEVIEWS", + "BIND_TEXT_SERVICE", + "BIND_TV_INPUT", + "BIND_VOICE_INTERACTION", + "BIND_VPN_SERVICE", + "BIND_WALLPAPER", + "BLUETOOTH", + "BLUETOOTH_ADMIN", + "BLUETOOTH_PRIVILEGED", + "BODY_SENSORS", + "BRICK", + "BROADCAST_PACKAGE_REMOVED", + "BROADCAST_SMS", + "BROADCAST_STICKY", + "BROADCAST_WAP_PUSH", + "CALL_PHONE", + "CALL_PRIVILEGED", + "CAMERA", + "CAPTURE_AUDIO_OUTPUT", + "CAPTURE_SECURE_VIDEO_OUTPUT", + "CAPTURE_VIDEO_OUTPUT", + "CHANGE_COMPONENT_ENABLED_STATE", + "CHANGE_CONFIGURATION", + "CHANGE_NETWORK_STATE", + "CHANGE_WIFI_MULTICAST_STATE", + "CHANGE_WIFI_STATE", + "CLEAR_APP_CACHE", + "CLEAR_APP_USER_DATA", + "CONTROL_LOCATION_UPDATES", + "DELETE_CACHE_FILES", + "DELETE_PACKAGES", + "DEVICE_POWER", + "DIAGNOSTIC", + "DISABLE_KEYGUARD", + "DUMP", + "EXPAND_STATUS_BAR", + "FACTORY_TEST", + "FLASHLIGHT", + "FORCE_BACK", + "GET_ACCOUNTS", + "GET_PACKAGE_SIZE", + "GET_TASKS", + "GET_TOP_ACTIVITY_INFO", + "GLOBAL_SEARCH", + "HARDWARE_TEST", + "INJECT_EVENTS", + "INSTALL_LOCATION_PROVIDER", + "INSTALL_PACKAGES", + "INSTALL_SHORTCUT", + "INTERNAL_SYSTEM_WINDOW", + "INTERNET", + "KILL_BACKGROUND_PROCESSES", + "LOCATION_HARDWARE", + "MANAGE_ACCOUNTS", + "MANAGE_APP_TOKENS", + "MANAGE_DOCUMENTS", + "MASTER_CLEAR", + "MEDIA_CONTENT_CONTROL", + "MODIFY_AUDIO_SETTINGS", + "MODIFY_PHONE_STATE", + "MOUNT_FORMAT_FILESYSTEMS", + "MOUNT_UNMOUNT_FILESYSTEMS", + "NFC", + "PERSISTENT_ACTIVITY", + "PROCESS_OUTGOING_CALLS", + "READ_CALENDAR", + "READ_CALL_LOG", + "READ_CONTACTS", + "READ_EXTERNAL_STORAGE", + "READ_FRAME_BUFFER", + "READ_HISTORY_BOOKMARKS", + "READ_INPUT_STATE", + "READ_LOGS", + "READ_PHONE_STATE", + "READ_PROFILE", + "READ_SMS", + "READ_SOCIAL_STREAM", + "READ_SYNC_SETTINGS", + "READ_SYNC_STATS", + "READ_USER_DICTIONARY", + "READ_VOICEMAIL", + "REBOOT", + "RECEIVE_BOOT_COMPLETED", + "RECEIVE_MMS", + "RECEIVE_SMS", + "RECEIVE_WAP_PUSH", + "RECORD_AUDIO", + "REORDER_TASKS", + "RESTART_PACKAGES", + "SEND_RESPOND_VIA_MESSAGE", + "SEND_SMS", + "SET_ACTIVITY_WATCHER", + "SET_ALARM", + "SET_ALWAYS_FINISH", + "SET_ANIMATION_SCALE", + "SET_DEBUG_APP", + "SET_ORIENTATION", + "SET_POINTER_SPEED", + "SET_PREFERRED_APPLICATIONS", + "SET_PROCESS_LIMIT", + "SET_TIME", + "SET_TIME_ZONE", + "SET_WALLPAPER", + "SET_WALLPAPER_HINTS", + "SIGNAL_PERSISTENT_PROCESSES", + "STATUS_BAR", + "SUBSCRIBED_FEEDS_READ", + "SUBSCRIBED_FEEDS_WRITE", + "SYSTEM_ALERT_WINDOW", + "TRANSMIT_IR", + "UNINSTALL_SHORTCUT", + "UPDATE_DEVICE_STATS", + "USE_CREDENTIALS", + "USE_SIP", + "VIBRATE", + "WAKE_LOCK", + "WRITE_APN_SETTINGS", + "WRITE_CALENDAR", + "WRITE_CALL_LOG", + "WRITE_CONTACTS", + "WRITE_EXTERNAL_STORAGE", + "WRITE_GSERVICES", + "WRITE_HISTORY_BOOKMARKS", + "WRITE_PROFILE", + "WRITE_SECURE_SETTINGS", + "WRITE_SETTINGS", + "WRITE_SMS", + "WRITE_SOCIAL_STREAM", + "WRITE_SYNC_SETTINGS", + "WRITE_USER_DICTIONARY", + "WRITE_VOICEMAIL" + ] }, { "type": "dict", @@ -17,7 +170,10 @@ "section": "app", "desc": "Use Android private/public storage", "key": "android.private_storage", - "options": {"False": "Public", "True": "Private"} + "options": { + "False": "Public", + "True": "Private" + } }, { "type": "string", @@ -32,7 +188,10 @@ "section": "app", "desc": "Indicate whether the screen should stay on. Don't forget to add the WAKE_LOCK permission if you set this to True", "key": "android.wakelock", - "options": {"False": "Disabled", "True": "Enabled"} + "options": { + "False": "Disabled", + "True": "Enabled" + } }, { "type": "list", @@ -111,7 +270,7 @@ "type": "string", "title": "OUYA Console icon", "section": "app", - "desc": "Filename of OUYA Console icon. It must be a 732x412 png image.\nExample: %(source.dir)s/data/ouya_icon.png", + "desc": "Filename of OUYA Console icon. It must be a 732x412 png image.\nExample: %(source.dir)s/assets/icons/ouya_icon.png", "key": "android.ouya.icon.filename" }, { @@ -264,4 +423,4 @@ "desc": "Copy library instead of making a libpymodules.so", "key": "android.copy_libs" } -] +] \ No newline at end of file diff --git a/designer/data/settings/buildozer_spec_app.json b/designer/tools/settings/buildozer_spec_app.json similarity index 59% rename from designer/data/settings/buildozer_spec_app.json rename to designer/tools/settings/buildozer_spec_app.json index 6b39fba..927e1d6 100644 --- a/designer/data/settings/buildozer_spec_app.json +++ b/designer/tools/settings/buildozer_spec_app.json @@ -28,14 +28,14 @@ "type": "string", "title": "Presplash of the application", "section": "app", - "desc": "Presplash image of the application.\nExample %(source.dir)s/data/logo.png", + "desc": "Presplash image of the application.\nExample %(source.dir)s/assets/icons/logo.png", "key": "presplash.filename" }, { "type": "string", "title": "Icon of the application", "section": "app", - "desc": "Icon of the application.\nExample %(source.dir)s/data/icon.png", + "desc": "Icon of the application.\nExample %(source.dir)s/assets/icons/icon.png", "key": "icon.filename" }, { @@ -48,14 +48,21 @@ "section": "app", "desc": "Application orientation", "key": "orientation", - "options": {"landscape": "Landscape", "portrait": "Portrait", "all": "Auto"} + "options": { + "landscape": "Landscape", + "portrait": "Portrait", + "all": "Auto" + } }, { "type": "bool", "title": "Fullscreen", "section": "app", "desc": "Fullscreen mode", - "values": ["Disabled", "Enabled"], + "values": [ + "Disabled", + "Enabled" + ], "key": "fullscreen" }, { @@ -76,7 +83,13 @@ "desc": "Source files to include (let empty to include all the files)", "key": "source.include_exts", "allow_custom": true, - "items": ["py","png","jpg","kv","atlas"] + "items": [ + "py", + "png", + "jpg", + "kv", + "atlas" + ] }, { "type": "list", @@ -85,7 +98,11 @@ "desc": "Source files to exclude (let empty to not exclude anything)", "key": "source.exclude_exts", "allow_custom": true, - "items": ["rar", "zip", "spec"] + "items": [ + "rar", + "zip", + "spec" + ] }, { "type": "list", @@ -94,7 +111,11 @@ "desc": "List of directory to exclude (let empty to not exclude anything)", "key": "source.exclude_dirs", "allow_custom": true, - "items": ["tests", "test", "bin"] + "items": [ + "tests", + "test", + "bin" + ] }, { "type": "list", @@ -103,7 +124,10 @@ "desc": "List of exclusions using pattern matching", "key": "source.exclude_patterns", "allow_custom": true, - "items": ["license","images/*/*.jpg"] + "items": [ + "license", + "images/*/*.jpg" + ] }, { "type": "list", @@ -112,7 +136,10 @@ "desc": "List of inclusions using pattern matching", "key": "source.include_patterns", "allow_custom": true, - "items": ["assets/*", "images/*.png"] + "items": [ + "assets/*", + "images/*.png" + ] }, { "type": "list", @@ -121,7 +148,10 @@ "desc": "List of services to declare", "key": "services", "allow_custom": true, - "items": ["NAME:ENTRYPOINT_TO_PY", "NAME2:ENTRYPOINT2_TO_PY"] + "items": [ + "NAME:ENTRYPOINT_TO_PY", + "NAME2:ENTRYPOINT2_TO_PY" + ] }, { "type": "title", @@ -158,7 +188,84 @@ "section": "app", "desc": "Application requirements.", "key": "requirements", - "items": ["apsw", "audiostream", "bidi", "boost", "c_igraph", "cherrypy", "cprotobuf", "cymunk", "django", "docutils", "ecdsa", "enum34", "evdev", "ffmpeg", "ffmpeg2", "ffpyplayer", "freetype", "gevent", "greenlet", "harfbuzz", "hostpython", "igraph", "jpeg", "kivent_core", "kivent_cymunk", "kivy", "leveldb", "libevent", "libpq", "libsodium", "libswift", "libtorrent", "libxml2", "libxslt", "libyaml", "lxml", "m2crypto", "midistream", "msgpack", "mysql_connector", "netifaces", "numpy", "opencv", "openssl", "paramiko", "pil", "plyer", "plyvel", "png", "polygon", "protobuf", "psutil", "psycopg2", "pyasn1", "pycrypto", "pygame", "pyjnius", "pylibpd", "pyopenssl", "pyparsing", "pyqrcode", "python", "pyyaml", "sdl", "setuptools", "six", "sqlalchemy", "sqlite3", "storm", "swift", "thrift", "twisted", "txws", "wokkel", "zeroconf", "zope"], + "items": [ + "apsw", + "audiostream", + "bidi", + "boost", + "c_igraph", + "cherrypy", + "cprotobuf", + "cymunk", + "django", + "docutils", + "ecdsa", + "enum34", + "evdev", + "ffmpeg", + "ffmpeg2", + "ffpyplayer", + "freetype", + "gevent", + "greenlet", + "harfbuzz", + "hostpython", + "igraph", + "jpeg", + "kivent_core", + "kivent_cymunk", + "kivy", + "leveldb", + "libevent", + "libpq", + "libsodium", + "libswift", + "libtorrent", + "libxml2", + "libxslt", + "libyaml", + "lxml", + "m2crypto", + "midistream", + "msgpack", + "mysql_connector", + "netifaces", + "numpy", + "opencv", + "openssl", + "paramiko", + "pil", + "plyer", + "plyvel", + "png", + "polygon", + "protobuf", + "psutil", + "psycopg2", + "pyasn1", + "pycrypto", + "pygame", + "pyjnius", + "pylibpd", + "pyopenssl", + "pyparsing", + "pyqrcode", + "python", + "pyyaml", + "sdl", + "setuptools", + "six", + "sqlalchemy", + "sqlite3", + "storm", + "swift", + "thrift", + "twisted", + "txws", + "wokkel", + "zeroconf", + "zope" + ], "allow_custom": true }, { @@ -168,6 +275,40 @@ "desc": "Application garden requirements.", "key": "garden_requirements", "allow_custom": true, - "items": ["androidtabs", "cefpython", "collider", "datetimepicker", "ddd", "desktopvideoplayer", "filebrowser", "filechooserthumbview", "gauge", "geartick", "graph", "knob", "magnet", "mapview", "modernmenu", "moretransitions", "navigationdrawer", "pagecurl", "particlesystem", "pizza", "progressspinner", "qrcode", "recycleview", "roulette", "roulettescroll", "scrolllabel", "segment", "smaa", "stiffscroll", "texturestack", "tickline", "tickmarker", "timeline"] + "items": [ + "androidtabs", + "cefpython", + "collider", + "datetimepicker", + "ddd", + "desktopvideoplayer", + "filebrowser", + "filechooserthumbview", + "gauge", + "geartick", + "graph", + "knob", + "magnet", + "mapview", + "modernmenu", + "moretransitions", + "navigationdrawer", + "pagecurl", + "particlesystem", + "pizza", + "progressspinner", + "qrcode", + "recycleview", + "roulette", + "roulettescroll", + "scrolllabel", + "segment", + "smaa", + "stiffscroll", + "texturestack", + "tickline", + "tickmarker", + "timeline" + ] } ] \ No newline at end of file diff --git a/designer/data/settings/buildozer_spec_buildozer.json b/designer/tools/settings/buildozer_spec_buildozer.json similarity index 100% rename from designer/data/settings/buildozer_spec_buildozer.json rename to designer/tools/settings/buildozer_spec_buildozer.json diff --git a/designer/data/settings/buildozer_spec_ios.json b/designer/tools/settings/buildozer_spec_ios.json similarity index 100% rename from designer/data/settings/buildozer_spec_ios.json rename to designer/tools/settings/buildozer_spec_ios.json diff --git a/designer/data/settings/designer_settings.json b/designer/tools/settings/designer_settings.json similarity index 100% rename from designer/data/settings/designer_settings.json rename to designer/tools/settings/designer_settings.json diff --git a/designer/data/settings/hanga_settings.json b/designer/tools/settings/hanga_settings.json similarity index 100% rename from designer/data/settings/hanga_settings.json rename to designer/tools/settings/hanga_settings.json diff --git a/designer/data/settings/proj_settings_proj_prop.json b/designer/tools/settings/proj_settings_proj_prop.json similarity index 100% rename from designer/data/settings/proj_settings_proj_prop.json rename to designer/tools/settings/proj_settings_proj_prop.json diff --git a/designer/data/settings/proj_settings_shell_env.json b/designer/tools/settings/proj_settings_shell_env.json similarity index 100% rename from designer/data/settings/proj_settings_shell_env.json rename to designer/tools/settings/proj_settings_shell_env.json diff --git a/designer/data/settings/shortcuts.json b/designer/tools/settings/shortcuts.json similarity index 100% rename from designer/data/settings/shortcuts.json rename to designer/tools/settings/shortcuts.json diff --git a/designer/data/new_templates/template_actionbar_carousel_kv b/designer/tools/templates/template_actionbar_carousel_kv similarity index 97% rename from designer/data/new_templates/template_actionbar_carousel_kv rename to designer/tools/templates/template_actionbar_carousel_kv index 4163c28..cbdc4bc 100644 --- a/designer/data/new_templates/template_actionbar_carousel_kv +++ b/designer/tools/templates/template_actionbar_carousel_kv @@ -6,7 +6,7 @@ #to your needs ActionBar: id: _action - size_hint: 1,0.1 + size_hint: 1, 0.1 pos_hint: {'top':1} ActionView: use_separator: True diff --git a/designer/data/new_templates/template_actionbar_carousel_py b/designer/tools/templates/template_actionbar_carousel_py similarity index 98% rename from designer/data/new_templates/template_actionbar_carousel_py rename to designer/tools/templates/template_actionbar_carousel_py index 684bd11..c90b162 100644 --- a/designer/data/new_templates/template_actionbar_carousel_py +++ b/designer/tools/templates/template_actionbar_carousel_py @@ -1,9 +1,7 @@ -from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.properties import ObjectProperty -from kivy.lang import Builder from kivy.uix import actionbar - +from kivy.app import App class RootWidget(FloatLayout): '''This is the class representing your root widget. diff --git a/designer/data/new_templates/template_actionbar_kv b/designer/tools/templates/template_actionbar_kv similarity index 96% rename from designer/data/new_templates/template_actionbar_kv rename to designer/tools/templates/template_actionbar_kv index 2c91aae..42065f6 100644 --- a/designer/data/new_templates/template_actionbar_kv +++ b/designer/tools/templates/template_actionbar_kv @@ -13,7 +13,7 @@ text: 'File' mode: 'spinner' size_hint_x: None - width: 90 + width: '90dp' ActionButton: text: 'New' ActionButton: diff --git a/designer/data/new_templates/template_actionbar_py b/designer/tools/templates/template_actionbar_py similarity index 100% rename from designer/data/new_templates/template_actionbar_py rename to designer/tools/templates/template_actionbar_py diff --git a/designer/data/new_templates/template_boxlayout_kv b/designer/tools/templates/template_boxlayout_kv similarity index 100% rename from designer/data/new_templates/template_boxlayout_kv rename to designer/tools/templates/template_boxlayout_kv diff --git a/designer/data/new_templates/template_boxlayout_py b/designer/tools/templates/template_boxlayout_py similarity index 100% rename from designer/data/new_templates/template_boxlayout_py rename to designer/tools/templates/template_boxlayout_py diff --git a/designer/data/new_templates/template_floatlayout_kv b/designer/tools/templates/template_floatlayout_kv similarity index 100% rename from designer/data/new_templates/template_floatlayout_kv rename to designer/tools/templates/template_floatlayout_kv diff --git a/designer/data/new_templates/template_floatlayout_py b/designer/tools/templates/template_floatlayout_py similarity index 100% rename from designer/data/new_templates/template_floatlayout_py rename to designer/tools/templates/template_floatlayout_py diff --git a/designer/data/new_templates/template_screen_manager_actionbar_kv b/designer/tools/templates/template_screen_manager_actionbar_kv similarity index 96% rename from designer/data/new_templates/template_screen_manager_actionbar_kv rename to designer/tools/templates/template_screen_manager_actionbar_kv index e49a07a..1adc154 100644 --- a/designer/data/new_templates/template_screen_manager_actionbar_kv +++ b/designer/tools/templates/template_screen_manager_actionbar_kv @@ -3,7 +3,7 @@ manager: manager ActionBar: id: _action - size_hint: 1,0.1 + size_hint: 1, 0.1 pos_hint: {'top':1} ActionView: use_separator: True diff --git a/designer/data/new_templates/template_screen_manager_actionbar_py b/designer/tools/templates/template_screen_manager_actionbar_py similarity index 87% rename from designer/data/new_templates/template_screen_manager_actionbar_py rename to designer/tools/templates/template_screen_manager_actionbar_py index 774a30a..cd36986 100644 --- a/designer/data/new_templates/template_screen_manager_actionbar_py +++ b/designer/tools/templates/template_screen_manager_actionbar_py @@ -1,10 +1,7 @@ from kivy.app import App -from kivy.uix.screenmanager import ScreenManager, Screen -from kivy.properties import NumericProperty, ObjectProperty -from kivy.lang import Builder +from kivy.properties import ObjectProperty from kivy.uix.floatlayout import FloatLayout - class RootWidget(FloatLayout): '''This the class representing your root widget. By default it is inherited from ScreenManager, diff --git a/designer/data/new_templates/template_screen_manager_kv b/designer/tools/templates/template_screen_manager_kv similarity index 100% rename from designer/data/new_templates/template_screen_manager_kv rename to designer/tools/templates/template_screen_manager_kv diff --git a/designer/data/new_templates/template_screen_manager_py b/designer/tools/templates/template_screen_manager_py similarity index 100% rename from designer/data/new_templates/template_screen_manager_py rename to designer/tools/templates/template_screen_manager_py diff --git a/designer/data/new_templates/template_tabbed_panel_kv b/designer/tools/templates/template_tabbed_panel_kv similarity index 100% rename from designer/data/new_templates/template_tabbed_panel_kv rename to designer/tools/templates/template_tabbed_panel_kv diff --git a/designer/data/new_templates/template_tabbed_panel_py b/designer/tools/templates/template_tabbed_panel_py similarity index 100% rename from designer/data/new_templates/template_tabbed_panel_py rename to designer/tools/templates/template_tabbed_panel_py diff --git a/designer/data/new_templates/template_textinput_scrollview_kv b/designer/tools/templates/template_textinput_scrollview_kv similarity index 100% rename from designer/data/new_templates/template_textinput_scrollview_kv rename to designer/tools/templates/template_textinput_scrollview_kv diff --git a/designer/data/new_templates/template_textinput_scrollview_py b/designer/tools/templates/template_textinput_scrollview_py similarity index 100% rename from designer/data/new_templates/template_textinput_scrollview_py rename to designer/tools/templates/template_textinput_scrollview_py diff --git a/designer/uix/action_items.py b/designer/uix/action_items.py index 3d1709d..30dc74c 100644 --- a/designer/uix/action_items.py +++ b/designer/uix/action_items.py @@ -16,9 +16,11 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + : info: info - background_normal: 'atlas://data/images/defaulttheme/action_bar' + background_normal: theme_atlas('action_bar') size_hint_x: None width: designer_action_width canvas.before: @@ -57,7 +59,7 @@ btn_layout: btn_layout _label: _label checkbox: checkbox - background_normal: 'atlas://data/images/defaulttheme/action_bar' + background_normal: theme_atlas('action_bar') size_hint: None, None height: '49sp' width: designer_action_width @@ -102,7 +104,7 @@ size_hint: 1, None width: designer_action_width height: '48sp' - background_normal: 'atlas://data/images/defaulttheme/action_bar' + background_normal: theme_atlas('action_bar') text_size: (self.width - sp(24), self.size[1]) valign: 'middle' diff --git a/designer/uix/code_find.py b/designer/uix/code_find.py index 819a5a8..77a9778 100644 --- a/designer/uix/code_find.py +++ b/designer/uix/code_find.py @@ -6,6 +6,8 @@ Builder.load_string(""" +#: import theme_atlas utils.utils.theme_atlas + : txt_query: txt_query size_hint_y: None @@ -63,7 +65,7 @@ size_hint_x: None width: '100dp' Image: - source: 'atlas://data/images/defaulttheme/close' + source: theme_atlas('close') size_hint: None, None size: designer_height, designer_height on_touch_down: if self.collide_point(*args[1].pos): root.dispatch('on_close') diff --git a/designer/utils/toolbox_widgets.py b/designer/utils/toolbox_widgets.py index fa2e27b..e412908 100644 --- a/designer/utils/toolbox_widgets.py +++ b/designer/utils/toolbox_widgets.py @@ -6,11 +6,13 @@ #: The third field represents initial widget values #: The fourth field are extra parameters used to display the widget while dragging +from utils.utils import icons + toolbox_widgets = [ ('Button', 'base', {'text': 'Button'}, {'size_hint': (None, None), 'size': ('150sp', '40sp')}), ('Carousel', 'base'), ('CheckBox', 'base', {'active': True}, {'size_hint': (None, None), 'size': ('50sp', '50sp')}), - ('Image', 'base', {'source': 'data/logo/kivy-icon-64.png'}, {'size_hint': (None, None), 'size': ('64dp', '64dp')}), + ('Image', 'base', {'source': icons('kivy-icon-64')}, {'size_hint': (None, None), 'size': ('64dp', '64dp')}), ('Label', 'base', {'text': 'Label'}, {'size_hint': (None, None), 'size': ('150sp', '40sp')}), ('ProgressBar', 'base', {}, {'size_hint': (None, None), 'size': ('150sp', '40sp')}), ('Screen', 'base'), diff --git a/designer/utils/utils.py b/designer/utils/utils.py index 382d835..138db82 100644 --- a/designer/utils/utils.py +++ b/designer/utils/utils.py @@ -32,6 +32,24 @@ def get_path(local): def icons(name, ext='.png'): return get_path(f'assets/icons/{name}{ext}') +def template_images(name, ext='.png'): + return get_path(f'assets/template_images/{name}{ext}') + +def template_file(name, ext=''): + return get_path(f'tools/templates/{name}{ext}') + +def config_path(name='', ext='.ini'): + if name != '': + return get_path(f'tools/{name}{ext}') + else: + return get_path('tools') + +def profiles_path(name='', ext='.ini'): + if name != '': + return get_path(f'tools/profiles/{name}{ext}') + else: + return get_path('tools/profiles') + def utils_source_rst(name, ext='.rst'): return get_path(f'utils/source/{name}{ext}') @@ -41,9 +59,6 @@ def utils_source_img(name, ext='.png'): class constants: DIR_NEW_TEMPLATE = 'new_templates' NEW_PROJECT_DIR_NAME_PREFIX = 'designer_' - NEW_TEMPLATE_IMAGE_PATH = os.path.join(DIR_NEW_TEMPLATE, 'images') - DIR_PROFILES = 'profiles' - DESIGNER_CONFIG_FILE_NAME = 'config.ini' class FakeSettingList(EventDispatcher): '''Fake Kivy Setting to use SettingList @@ -165,7 +180,7 @@ def get_kd_dir(): def get_kd_data_dir(): '''Return kivy designer's data path ''' - return os.path.join(get_kd_dir(), 'data') + return os.path.join(get_kd_dir(), 'tools') def show_alert(title, msg, width=500, height=200):