def set_status_view(self): """Set the message and color of the status pilot on the top bar""" size = context.get_mainwindow().get_size() k1 = size[0] / 1920.0 l = Gtk.ListStore(str,str,str) main_window = context.get_mainwindow() main_window.realize() for i in STATUSES: l.append([_(i.description), i.bg_color, i.fg_color]) v = Gtk.CellView() v.set_model(l) v.get_style_context().add_class('label_extrabig') r = Gtk.CellRendererText() self.renderer=r r.set_alignment(0.5,0.5) v.pack_start(r,True) v.add_attribute(r, "text", 0) v.add_attribute(r, "background", 1) v.add_attribute(r, "foreground", 2) v.set_displayed_row(Gtk.TreePath(0)) relabel(v,k1*42,True) return v
def set_status_view(self): """Set the message and color of the status pilot on the top bar""" size = context.get_mainwindow().get_size() k1 = size[0] / 1920.0 l = Gtk.ListStore(str, str, str) main_window = context.get_mainwindow() main_window.realize() for i in STATUSES: l.append([_(i.description), i.bg_color, i.fg_color]) v = Gtk.CellView() v.set_model(l) v.get_style_context().add_class('label_extrabig') r = Gtk.CellRendererText() self.renderer = r r.set_alignment(0.5, 0.5) v.pack_start(r, True) v.add_attribute(r, "text", 0) v.add_attribute(r, "background", 1) v.add_attribute(r, "foreground", 2) v.set_displayed_row(Gtk.TreePath(0)) relabel(v, k1 * 42, True) return v
def resize(self): size = context.get_mainwindow().get_size() altura = size[1] anchura = size[0] k = anchura / 1920.0 builder= self.builder logos = builder.get_object("logo_align") logos.set_padding(int(k*52),int(k*30),0,0) disal = builder.get_object("dis_align") #disal.set_padding(int(k*25),int(k*25),int(k*50),int(k*50)) l1 = builder.get_object("reclabel") l2 = builder.get_object("mmlabel") l3 = builder.get_object("selected_profile") i1 = builder.get_object("recimage") i2 = builder.get_object("mmimage") b1 = builder.get_object("button1") b2 = builder.get_object("button2") relabel(l1,k*48,True) relabel(l2,k*48,True) relabel(l3,k*26,True) i1.set_pixel_size(int(k*120)) i2.set_pixel_size(int(k*120)) b1.set_property("width-request", int(anchura/3.5) ) b2.set_property("width-request", int(anchura/3.5) ) b1.set_property("height-request", int(anchura/3.5) ) b2.set_property("height-request", int(anchura/3.5) ) lclass = builder.get_object("logo2") lcompany = builder.get_object("logo1") iclass=gtk.gdk.pixbuf_new_from_file(get_image_path("logo.svg")) icompany=gtk.gdk.pixbuf_new_from_file(get_image_path("teltek.svg")) iclass = iclass.scale_simple( int(iclass.get_width()*k), int(iclass.get_height()*k), gtk.gdk.INTERP_BILINEAR) icompany = icompany.scale_simple( int(icompany.get_width()*k), int(icompany.get_height()*k), gtk.gdk.INTERP_BILINEAR) lclass.set_from_pixbuf(iclass) lcompany.set_from_pixbuf(icompany)
def resize(self): size = context.get_mainwindow().get_size() anchura = size[0] k = anchura / 1920.0 builder= self.builder logos = builder.get_object("logo_align") logos.set_padding(int(k*52),int(k*30),0,0) # disal = builder.get_object("dis_align") # disal.set_padding(int(k*25),int(k*25),int(k*50),int(k*50)) l1 = builder.get_object("reclabel") l2 = builder.get_object("mmlabel") l3 = builder.get_object("selected_profile") i1 = builder.get_object("recimage") i2 = builder.get_object("mmimage") b1 = builder.get_object("button1") b2 = builder.get_object("button2") relabel(l1,k*48,True) relabel(l2,k*48,True) relabel(l3,k*26,True) i1.set_pixel_size(int(k*120)) i2.set_pixel_size(int(k*120)) b1.set_property("width-request", int(anchura/3.5) ) b2.set_property("width-request", int(anchura/3.5) ) b1.set_property("height-request", int(anchura/3.5) ) b2.set_property("height-request", int(anchura/3.5) ) lclass = builder.get_object("logo2") lcompany = builder.get_object("logo1") iclass=gtk.gdk.pixbuf_new_from_file(get_image_path("logo.svg")) icompany=gtk.gdk.pixbuf_new_from_file(get_image_path("teltek.svg")) iclass = iclass.scale_simple( int(iclass.get_width()*k), int(iclass.get_height()*k), gtk.gdk.INTERP_BILINEAR) icompany = icompany.scale_simple( int(icompany.get_width()*k), int(icompany.get_height()*k), gtk.gdk.INTERP_BILINEAR) lclass.set_from_pixbuf(iclass) lcompany.set_from_pixbuf(icompany)
def resize(self): size = context.get_mainwindow().get_size() anchura = size[0] k = anchura / 1920.0 builder= self.builder l1 = builder.get_object("reclabel") l2 = builder.get_object("mmlabel") l3 = builder.get_object("selected_profile") i1 = builder.get_object("recimage") i2 = builder.get_object("mmimage") b1 = builder.get_object("button1") b2 = builder.get_object("button2") relabel(l1,k*48,True) relabel(l2,k*48,True) relabel(l3,k*26,True) i1.set_pixel_size(int(k*120)) i2.set_pixel_size(int(k*120)) b1.set_property("width-request", int(anchura/3.5) ) b2.set_property("width-request", int(anchura/3.5) ) b1.set_property("height-request", int(anchura/3.5) ) b2.set_property("height-request", int(anchura/3.5) )
def resize(self): """Adapts GUI elements to the screen size""" size = context.get_mainwindow().get_size() altura = size[1] anchura = size[0] k1 = anchura / 1920.0 k2 = altura / 1080.0 self.proportion = k1 #Recorder clock = self.gui.get_object("local_clock") logo = self.gui.get_object("classlogo") nextl = self.gui.get_object("nextlabel") title = self.gui.get_object("titlelabel") # eventl = self.gui.get_object("eventlabel") pbox = self.gui.get_object("prebox") rec_title = self.gui.get_object("recording1") rec_elapsed = self.gui.get_object("recording3") status_panel = self.gui.get_object('status_panel') l1 = self.gui.get_object("tab1") l2 = self.gui.get_object("tab2") l3 = self.gui.get_object("tab3") relabel(clock, k1 * 25, False) font = pango.FontDescription("bold " + str(int(k2 * 48))) self.renderer.set_property('font-desc', font) self.renderer.set_fixed_size(int(k2 * 400), -1) pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg')) pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k1), int(pixbuf.get_height() * k1), gtk.gdk.INTERP_BILINEAR) logo.set_from_pixbuf(pixbuf) modification = "bold " + str(k1 * 42) self.font = pango.FontDescription(modification) relabel(nextl, k1 * 25, True) relabel(title, k1 * 33, True) # REC AND STATUS PANEL relabel(rec_title, k1 * 25, True) rec_title.set_line_wrap(True) rec_title.set_width_chars(40) relabel(rec_elapsed, k1 * 28, True) for child in status_panel.get_children(): if type(child) is gtk.Label: relabel(child, k1 * 19, True) relabel(l1, k1 * 20, False) relabel(l2, k1 * 20, False) relabel(l3, k1 * 20, False) for name in ["recbutton", "pausebutton", "stopbutton", "helpbutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1 * 100)) button.set_property("height-request", int(k1 * 100)) image = button.get_children() if type(image[0]) == gtk.Image: image[0].set_pixel_size(int(k1 * 80)) elif type(image[0]) == gtk.VBox: for element in image[0].get_children(): if type(element) == gtk.Image: element.set_pixel_size(int(k1 * 46)) else: relabel(image[0], k1 * 28, False) for name in ["previousbutton", "morebutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1 * 70)) button.set_property("height-request", int(k1 * 70)) image = button.get_children() if type(image[0]) == gtk.Image: image[0].set_pixel_size(int(k1 * 56)) talign = self.gui.get_object("top_align") talign.set_padding(int(k1 * 10), int(k1 * 25), 0, 0) calign = self.gui.get_object("control_align") calign.set_padding(int(k1 * 10), int(k1 * 30), int(k1 * 50), int(k1 * 50)) vum = self.gui.get_object("vubox") vum.set_padding(int(k1 * 20), int(k1 * 10), int(k1 * 40), int(k1 * 40)) pbox.set_property("width-request", int(k1 * 225)) return True
def resize(self): """Adapts GUI elements to the screen size""" size = context.get_mainwindow().get_size() anchura = size[0] k1 = anchura / 1920.0 self.proportion = k1 #Recorder clock = self.gui.get_object("local_clock") logo = self.gui.get_object("classlogo") nextl = self.gui.get_object("nextlabel") title = self.gui.get_object("titlelabel") pbox = self.gui.get_object("prebox") rec_title = self.gui.get_object("recording1") status_panel = self.gui.get_object('status_panel') l1 = self.gui.get_object("tab1") l2 = self.gui.get_object("tab2") l3 = self.gui.get_object("tab3") relabel(clock, k1 * 25, False) pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg')) pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k1 * 0.5), int(pixbuf.get_height() * k1 * 0.5), GdkPixbuf.InterpType.BILINEAR) logo.set_from_pixbuf(pixbuf) modification = "bold " + str(k1 * 42) self.font = Pango.FontDescription(modification) relabel(nextl, k1 * 25, True) relabel(title, k1 * 33, True) # REC AND STATUS PANEL relabel(rec_title, k1 * 25, True) rec_title.set_line_wrap(True) for child in status_panel.get_children(): if type(child) is Gtk.Label: relabel(child, k1 * 19, True) relabel(l1, k1 * 20, False) relabel(l2, k1 * 20, False) relabel(l3, k1 * 20, False) # change stop button for name in ["pause", "stop"]: button = self.gui.get_object(name + "button") image = button.get_children()[0] pixbuf = GdkPixbuf.Pixbuf.new_from_file( get_image_path('gc-' + name + '.svg')) pixbuf = pixbuf.scale_simple(int(60 * k1), int(60 * k1), GdkPixbuf.InterpType.BILINEAR) image.set_from_pixbuf(pixbuf) for name in ["previousbutton", "morebutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1 * 250)) button.set_property("height-request", int(k1 * 70)) image = button.get_children() if type(image[0]) == Gtk.Image: image[0].set_pixel_size(int(k1 * 56)) vum = self.gui.get_object("vubox") vum.set_padding(int(k1 * 20), int(k1 * 10), 0, 0) pbox.set_property("width-request", int(k1 * 225)) hbox1 = self.gui.get_object('hbox1') hbox1.set_property('spacing', int(k1 * 325)) for name in [ "recbutton", "pausebutton", "stopbutton", "helpbutton", "editbutton", "swapbutton" ]: button = self.gui.get_object(name) resize_button(button, size_image=k1 * 60, size_box=k1 * 46, size_label=k1 * 16) return True
def resize(self): """Adapts GUI elements to the screen size""" size = context.get_mainwindow().get_size() altura = size[1] anchura = size[0] k1 = anchura / 1920.0 k2 = altura / 1080.0 self.proportion = k1 #Recorder clock = self.gui.get_object("local_clock") logo = self.gui.get_object("classlogo") nextl = self.gui.get_object("nextlabel") title = self.gui.get_object("titlelabel") # eventl = self.gui.get_object("eventlabel") pbox = self.gui.get_object("prebox") rec_title = self.gui.get_object("recording1") rec_elapsed = self.gui.get_object("recording3") status_panel = self.gui.get_object('status_panel') l1 = self.gui.get_object("tab1") l2 = self.gui.get_object("tab2") l3 = self.gui.get_object("tab3") relabel(clock,k1*25,False) font = pango.FontDescription("bold "+str(int(k2*48))) self.renderer.set_property('font-desc', font) self.renderer.set_fixed_size(int(k2*400),-1) pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg')) pixbuf = pixbuf.scale_simple( int(pixbuf.get_width()*k1), int(pixbuf.get_height()*k1), gtk.gdk.INTERP_BILINEAR) logo.set_from_pixbuf(pixbuf) modification = "bold "+str(k1*42) self.font = pango.FontDescription(modification) relabel(nextl,k1*25,True) relabel(title,k1*33,True) # REC AND STATUS PANEL relabel(rec_title, k1*25, True) rec_title.set_line_wrap(True) rec_title.set_width_chars(40) relabel(rec_elapsed, k1*28, True) for child in status_panel.get_children(): if type(child) is gtk.Label: relabel(child,k1*19,True) relabel(l1,k1*20,False) relabel(l2,k1*20,False) relabel(l3,k1*20,False) for name in ["recbutton","pausebutton","stopbutton","editbutton","swapbutton","helpbutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1*100) ) button.set_property("height-request", int(k1*100) ) image = button.get_children() if type(image[0]) == gtk.Image: image[0].set_pixel_size(int(k1*80)) elif type(image[0]) == gtk.VBox: for element in image[0].get_children(): if type(element) == gtk.Image: element.set_pixel_size(int(k1*46)) else: relabel(image[0],k1*28,False) # change stop button for name in ["pause","stop"]: button = self.gui.get_object(name+"button") image = button.get_children()[0] pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('gc-'+name+'.svg')) pixbuf = pixbuf.scale_simple( int(80*k1), int(80*k1), gtk.gdk.INTERP_BILINEAR) image.set_from_pixbuf(pixbuf) for name in ["previousbutton", "morebutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1*70) ) button.set_property("height-request", int(k1*70) ) image = button.get_children() if type(image[0]) == gtk.Image: image[0].set_pixel_size(int(k1*56)) talign = self.gui.get_object("top_align") talign.set_padding(int(k1*10),int(k1*25),0,0) calign = self.gui.get_object("control_align") calign.set_padding(int(k1*10),int(k1*30),int(k1*50),int(k1*50)) vum = self.gui.get_object("vubox") vum.set_padding(int(k1*20),int(k1*10),int(k1*40),int(k1*40)) pbox.set_property("width-request", int(k1*225) ) return True
def resize(self): """Adapts GUI elements to the screen size""" size = context.get_mainwindow().get_size() anchura = size[0] k1 = anchura / 1920.0 self.proportion = k1 #Recorder clock = self.gui.get_object("local_clock") logo = self.gui.get_object("classlogo") nextl = self.gui.get_object("nextlabel") title = self.gui.get_object("titlelabel") pbox = self.gui.get_object("prebox") rec_title = self.gui.get_object("recording1") status_panel = self.gui.get_object('status_panel') l1 = self.gui.get_object("tab1") l2 = self.gui.get_object("tab2") l3 = self.gui.get_object("tab3") relabel(clock,k1*25,False) pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg')) pixbuf = pixbuf.scale_simple( int(pixbuf.get_width()*k1*0.5), int(pixbuf.get_height()*k1*0.5), GdkPixbuf.InterpType.BILINEAR) logo.set_from_pixbuf(pixbuf) modification = "bold "+str(k1*42) self.font = Pango.FontDescription(modification) relabel(nextl,k1*25,True) relabel(title,k1*33,True) # REC AND STATUS PANEL relabel(rec_title, k1*25, True) rec_title.set_line_wrap(True) for child in status_panel.get_children(): if type(child) is Gtk.Label: relabel(child,k1*19,True) relabel(l1,k1*20,False) relabel(l2,k1*20,False) relabel(l3,k1*20,False) # change stop button for name in ["pause","stop"]: button = self.gui.get_object(name+"button") image = button.get_children()[0] pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('gc-'+name+'.svg')) pixbuf = pixbuf.scale_simple( int(60*k1), int(60*k1), GdkPixbuf.InterpType.BILINEAR) image.set_from_pixbuf(pixbuf) for name in ["previousbutton", "morebutton"]: button = self.gui.get_object(name) button.set_property("width-request", int(k1*250) ) button.set_property("height-request", int(k1*70) ) image = button.get_children() if type(image[0]) == Gtk.Image: image[0].set_pixel_size(int(k1*56)) vum = self.gui.get_object("vubox") vum.set_padding(int(k1*20),int(k1*10),0,0) pbox.set_property("width-request", int(k1*225) ) hbox1 = self.gui.get_object('hbox1') hbox1.set_property('spacing', int(k1*325)) for name in ["recbutton","pausebutton","stopbutton","helpbutton","editbutton","swapbutton"]: button = self.gui.get_object(name) resize_button(button,size_image=k1*60,size_box=k1*46,size_label=k1*16) return True