# HG changeset patch # User Goffi # Date 1523023934 -7200 # Node ID 0ec3c3c0ed920d6043c1ce462014bc145abb65c6 # Parent 0704f3be65cbc1f61cad415533f02a6409de17a0 core (kv): new base.kv to handle default properties overriding on Kivy widgets diff -r 0704f3be65cb -r 0ec3c3c0ed92 cagou/core/cagou_main.py --- a/cagou/core/cagou_main.py Fri Apr 06 16:11:00 2018 +0200 +++ b/cagou/core/cagou_main.py Fri Apr 06 16:12:14 2018 +0200 @@ -376,9 +376,20 @@ def _import_kv(self): """import all kv files in cagou.kv""" path = os.path.dirname(cagou.kv.__file__) - for kv_path in glob.glob(os.path.join(path, "*.kv")): - Builder.load_file(kv_path) - log.debug(u"kv file {} loaded".format(kv_path)) + kv_files = glob.glob(os.path.join(path, "*.kv")) + # we want to be sure that base.kv is loaded first + # as it override some Kivy widgets properties + for kv_file in kv_files: + if kv_file.endswith('base.kv'): + kv_files.remove(kv_file) + kv_files.insert(0, kv_file) + break + else: + raise exceptions.InternalError("base.kv is missing") + + for kv_file in kv_files: + Builder.load_file(kv_file) + log.debug(u"kv file {} loaded".format(kv_file)) def _import_plugins(self): """import all plugins""" diff -r 0704f3be65cb -r 0ec3c3c0ed92 cagou/kv/base.kv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cagou/kv/base.kv Fri Apr 06 16:12:14 2018 +0200 @@ -0,0 +1,15 @@ +# Cagou: desktop/mobile frontend for Salut à Toi XMPP client +# Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see .