forked from martyr-deepin/deepin-ui
/
deepin_lunar_demo.py
executable file
·64 lines (53 loc) · 2.05 KB
/
deepin_lunar_demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Deepin, Inc.
# 2013 Zhai Xiang
#
# Author: Zhai Xiang <zhaixiang@linuxdeepin.com>
# Maintainer: Zhai Xiang <zhaixiang@linuxdeepin.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from dtk.ui.init_skin import init_skin
from deepin_utils.file import get_parent_dir, get_current_dir
import os
app_theme = init_skin(
"deepin-ui-demo",
"1.0",
"01",
os.path.join(get_parent_dir(__file__), "skin"),
os.path.join(get_parent_dir(__file__), "app_theme"),
)
import deepin_lunar
from dtk.ui.application import Application
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
if __name__ == "__main__":
# Init application.
application = Application()
# Set application default size.
application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
# Set application icon.
application.set_icon(os.path.join(get_current_dir(__file__), "icon.ico"))
# Set application preview pixbuf.
application.set_skin_preview(os.path.join(get_current_dir(__file__), "frame.png"))
# Add titlebar.
application.add_titlebar(
["theme", "max", "min", "close"],
os.path.join(get_current_dir(__file__), "logo.png"),
"TimeZone demo",
"TimeZone demo",
)
deepin_lunar_obj = deepin_lunar.new()
deepin_lunar_obj.mark_day(11)
application.main_box.pack_start(deepin_lunar_obj.get_handle())
application.run()