#! /usr/bin/env python
# -*- coding: utf-8 -*-

from dtk.ui.init_skin import init_skin
import os
from deepin_utils.file import get_parent_dir, get_current_dir
app_theme = init_skin(
    "deepin-ui",
    "1.0",
    "default",
    os.path.join(get_parent_dir(__file__, 2), "skin"),
    os.path.join(get_current_dir(__file__), "app_theme"),
)
from dtk.ui.application import Application
from dtk.ui.button import ImageButton
from dtk.ui.dialog import ConfirmDialog
import gtk

if __name__ == "__main__":
    application = Application()
    application.set_default_size(600, 450)
    application.add_titlebar(title="ImageButton example!")

    image_button = ImageButton(
        normal_dpixbuf=app_theme.get_pixbuf("action/play_normal.png"),
        hover_dpixbuf=app_theme.get_pixbuf("action/play_hover.png"),
        press_dpixbuf=app_theme.get_pixbuf("action/play_press.png"),
        insensitive_dpixbuf=None,
        scale_x=False,
        content=None,
    )
Пример #2
0
#               2011 ~ 2012 Wang Yong
# 
# Author:     Wang Yong <*****@*****.**>
# Maintainer: Wang Yong <*****@*****.**>
# 
# 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 widget.constant import PROGRAM_NAME, PROGRAM_VERSION
from dtk.ui.init_skin import init_skin
from deepin_utils.file import get_parent_dir
import os

app_theme = init_skin(
    PROGRAM_NAME,
    PROGRAM_VERSION,
    "dark_black",
    os.path.join(get_parent_dir(__file__, 2), "skin"),
    os.path.join(get_parent_dir(__file__, 2), "app_theme"),
    )
Пример #3
0
# 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"),
    )

from dtk.ui.application import Application
from dtk.ui.dragable_tab import TabBox
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
import gtk

if __name__ == "__main__":
    # Init application.
    application = Application()

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
Пример #4
0
# 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
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"),
    )
from dtk.ui.treeview import TreeItem, TreeView
from dtk.ui.draw import draw_text
from dtk.ui.utils import (color_hex_to_cairo, is_left_button, 
                          is_double_click, is_single_click)
from gtk import gdk
from gtk import accelerator_name, accelerator_parse, accelerator_get_label
import gobject
import copy

class MyTreeView(TreeView):
    ''' my TreeView'''
    __gsignals__ = {
Пример #5
0
# 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
from dtk.ui.theme import DynamicPixbuf, DynamicColor
import os

app_theme = init_skin(
    "deepin-screenshot",
    "2.1",
    "01",
    os.path.join(get_parent_dir(__file__, 2), "weibo_skin"),
    os.path.join(get_parent_dir(__file__, 2), "weibo_theme"),
)


def app_theme_get_pixbuf(filename):
    """
    from file get theme pixbuf
    @param filename: the image filename
    @return: a gtk.gdk.Pixbuf
    """
    return app_theme.get_pixbuf(filename).get_pixbuf()


def app_theme_get_dynamic_pixbuf(filename):
Пример #6
0
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
#               2011 ~ 2012 Wang Yong
#
# Author:     Wang Yong <*****@*****.**>
# Maintainer: Wang Yong <*****@*****.**>
#
# 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
import os

app_theme = init_skin(
    "deepin-system-settings",
    "1.0",
    "01",
    os.path.join(get_parent_dir(__file__, 2), "skin"),
    os.path.join(get_parent_dir(__file__, 2), "app_theme"),
    )
Пример #7
0
# 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
from constant import PROGRAM_VERSION, PROGRAM_NAME
from dtk.ui.theme import DynamicPixbuf, DynamicColor
import os

app_theme = init_skin(
    PROGRAM_NAME,
    PROGRAM_VERSION,
    "01",
    os.path.join(get_parent_dir(__file__, 2), "skin"),
    os.path.join(get_parent_dir(__file__, 2), "app_theme"),
)


def app_theme_get_dynamic_pixbuf(filename):
    '''
    from file get dynamic pixbuf
    @param filename: the image filename
    @return: a DynamicPixbuf
    '''
    return DynamicPixbuf(app_theme.get_theme_file_path(filename))


def app_theme_get_dynamic_color(color):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

from dtk.ui.init_skin import init_skin
import os
from deepin_utils.file import get_parent_dir, get_current_dir
app_theme = init_skin(
        "deepin-ui",
        "1.0",
        "default",
        os.path.join(get_parent_dir(__file__, 2), "skin"),
        os.path.join(get_current_dir(__file__), "app_theme"),
        )
from dtk.ui.application import Application
from dtk.ui.button import ImageButton
from dtk.ui.dialog import ConfirmDialog
import gtk

if __name__ == "__main__":
    application = Application()
    application.set_default_size(600, 450)
    application.add_titlebar(title="ImageButton example!")
    
    image_button = ImageButton(
        normal_dpixbuf=app_theme.get_pixbuf("action/play_normal.png"),
        hover_dpixbuf=app_theme.get_pixbuf("action/play_hover.png"),
        press_dpixbuf=app_theme.get_pixbuf("action/play_press.png"),
        insensitive_dpixbuf=None,
        scale_x=False,
        content=None,
        )
Пример #9
0
#               2011 ~ 2012 Wang Yong
#
# Author:     Wang Yong <*****@*****.**>
# Maintainer: Wang Yong <*****@*****.**>
#
# 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 constant import PROGRAM_NAME, PROGRAM_VERSION
from dtk.ui.init_skin import init_skin
from dtk.ui.utils import get_parent_dir
import os

app_theme = init_skin(
    PROGRAM_NAME,
    PROGRAM_VERSION,
    "blue",
    os.path.join(get_parent_dir(__file__, 2), "../skin"),
    os.path.join(get_parent_dir(__file__, 2), "../app_theme"),
)
Пример #10
0
#
# 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
from dtk.ui.theme import DynamicPixbuf, DynamicColor
import os

app_theme = init_skin("deepin-screenshot", "2.1", "01",
                      os.path.join(get_parent_dir(__file__, 2), "weibo_skin"),
                      os.path.join(get_parent_dir(__file__, 2), "weibo_theme"))


def app_theme_get_pixbuf(filename):
    '''
    from file get theme pixbuf
    @param filename: the image filename
    @return: a gtk.gdk.Pixbuf
    '''
    return app_theme.get_pixbuf(filename).get_pixbuf()


def app_theme_get_dynamic_pixbuf(filename):
    '''
    from file get dynamic pixbuf