예제 #1
0
 def __init__(self):
     super().__init__()
     self.button = Mx.Button()
     self.button.set_label("Don't click")
     self.add_child(self.button)
     self.layout = Clutter.BinLayout()
     self.set_layout_manager(self.layout)
예제 #2
0
    def make_keyboard(self, keyset=0):
        # yapf: disable
        keys = [[["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", " << "],
                 ["a", "s", "d", "f", "g", "h", "j", "k", "l", "'"],
                 [" ^", "z", "x", "c", "v", "b", "n", "m", ",", ".", " ^"],
                 [" 123 ", "                                        ", " }]? "]
                ],
                [["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " << "],
                 ["=", "-", "+", "*", "/", "\\", ":", ";", "'", "\""],
                 ["(", ")", "#", "$", "!", "?", "@", "m", ",", "."],
                 [" ABC ", "                                        ", " ABC "]
                ],
                [["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", " << "],
                 ["A", "S", "D", "F", "G", "H", "J", "K", "L", "'"],
                 ["^ ", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "^ "],
                 [" 123 ", "                                        ", " }]? "]
               ]]
        # yapf: enable

        for i, row in enumerate(keys[keyset]):
            key_row = self.config.ui.get_object("row-" + str(i))
            key_row.remove_all_children()
            for letter in row:
                key = Mx.Button()
                key.set_style_class("keyboard")
                key.set_label(letter)
                key.letter = letter
                key_row.add_actor(key)
                tap = Clutter.TapAction()
                key.add_action(tap)
                tap.connect("tap", self.keyboard_tap)

        self.config.ui.get_object("wifi-overlay").show()
예제 #3
0
    def __init__(self):
        super().__init__()
        self.button = Mx.Button()

        self.script = Clutter.Script()
        self.script.load_from_file('concept/mxButton/button.json')

        self.button = self.script.get_object('button')

        self.icon = self.script.get_object('icon')

        handle = Rsvg.Handle()
        svg = handle.new_from_file('concept/mxButton/edytuj.svg')

        pixbuf = svg.get_pixbuf()

        pixbuf = pixbuf.scale_simple(100, 100, 3)

        self.icon.set_from_data(pixbuf.get_pixels(),
                                Cogl.PixelFormat.RGBA_8888, pixbuf.get_width(),
                                pixbuf.get_height(), pixbuf.get_rowstride())

        self.add_child(self.button)
        self.layout = Clutter.BinLayout()
        self.set_layout_manager(self.layout)
예제 #4
0
 def __init__(self):
     super().__init__()
     self.button = Mx.Button()
     self.style = Mx.Style()
     self.style.load_from_file(os.path.join(res.PATH, "style.css"))
     self.button.set_style(self.style)
     self.button.set_label("Don't click")
     print(self.button.list_properties())
     self.add_child(self.button)
예제 #5
0
    def __init__(self):
        super().__init__()
        self.button = Mx.Button()
        self.button.connect("clicked", self.move_cursor)
        self.button.set_label("Click me to move cursor to (0, 0) position")

        self.display = Gdk.Display.get_default()
        self.screen = self.display.get_default_screen()

        self.add_child(self.button)
        self.layout = Clutter.BinLayout()
        self.set_layout_manager(self.layout)
예제 #6
0
    def __init__(self):
        super().__init__()

        self.layout = Clutter.BoxLayout()
        self.set_layout_manager(self.layout)

        # Uncomment one of these lines
        #self.box = self.create_box_actor()
        #self.box = self.create_box_mx()
        self.box = self.create_box_custom()

        self.box.set_x_expand(True)
        self.box.set_y_expand(True)
        self.add_child(self.box)

        self.button_a = Mx.Button()
        self.button_a.set_label("A")
        self.box.add_child(self.button_a)

        self.button_b = Mx.Button()
        self.button_b.set_label("B")
        self.button_b.set_x_expand(True)
        self.box.add_child(self.button_b)
예제 #7
0
def make_keyboard(ui):
    # yapf: disable
    keys = [["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "<<"],
            ["a", "s", "d", "f", "g", "h", "j", "k", "l", "m"],
            [" ^", "z", "x", "c", "v", "b", "n", "m", ",", ".", "^ "],
            [" 123 ", "                                        ", " }]? "]
           ]
    # yapf: enable

    for i, row in enumerate(keys):
        key_row = ui.get_object("row-" + str(i))
        for letter in row:
            key = Mx.Button()
            key.set_style_class("keyboard")
            #key.set_property("min-width", 20)
            key.set_label(letter)
            key_row.add_actor(key)