fixed Preference window look
This commit is contained in:
parent
f9b138f66b
commit
36f2e9add1
2 changed files with 62 additions and 27 deletions
|
@ -1,41 +1,73 @@
|
|||
from gi.repository import Gtk
|
||||
import webkit
|
||||
import gtk, webkit
|
||||
|
||||
class Preferences(Gtk.Window):
|
||||
class Preferences:
|
||||
|
||||
def __init__(self, app):
|
||||
|
||||
self.app = app
|
||||
Gtk.Window.__init__(self, title="Preferences")
|
||||
self.connect("delete-event", self.quit)
|
||||
self.window = gtk.Window()
|
||||
self.window.set_title("Preferences")
|
||||
self.window.set_position(gtk.WIN_POS_CENTER)
|
||||
self.window.connect("delete-event", self.quit)
|
||||
|
||||
self.login_button = Gtk.Button(label="Login")
|
||||
hbox1 = gtk.HBox()
|
||||
self.window.add(hbox1)
|
||||
|
||||
icon = gtk.Image()
|
||||
pixbuffer = gtk.gdk.pixbuf_new_from_file(self.app.resources_path() + "Icon.png")
|
||||
scaled_buffer = pixbuffer.scale_simple(150, 150, gtk.gdk.INTERP_BILINEAR)
|
||||
icon.set_from_pixbuf(scaled_buffer)
|
||||
hbox1.pack_start(icon, False, False, 20)
|
||||
|
||||
fix = gtk.Fixed()
|
||||
hbox1.pack_start(fix, False, False, 20)
|
||||
|
||||
label = gtk.Label("Please enter your entity:")
|
||||
fix.put(label, 0, 30)
|
||||
|
||||
self.entity_entry = gtk.Entry()
|
||||
self.entity_entry.set_width_chars(36)
|
||||
fix.put(self.entity_entry, 0, 52)
|
||||
|
||||
self.login_button = gtk.Button(label="Login")
|
||||
self.login_button.connect("clicked", self.on_login_button_clicked)
|
||||
self.add(self.login_button)
|
||||
fix.put(self.login_button, 248, 82)
|
||||
|
||||
def quit(self):
|
||||
self.hide_all()
|
||||
self.window.show_all()
|
||||
self.window.hide()
|
||||
|
||||
def quit(self, wiget, foo):
|
||||
self.window.hide()
|
||||
self.app.quit(self)
|
||||
|
||||
def on_login_button_clicked(self, widget):
|
||||
print "Login"
|
||||
|
||||
def show(self):
|
||||
self.window.show()
|
||||
|
||||
class Timeline(Gtk.Window):
|
||||
def hide(self):
|
||||
self.window.hide()
|
||||
|
||||
def __init(self, app):
|
||||
class Timeline:
|
||||
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
Gtk.Window.__init__(self, title="Tentia")
|
||||
self.connect("delete-event", self.quit)
|
||||
self.window = gtk.Window()
|
||||
self.window.connect("delete-event", self.quit)
|
||||
|
||||
scroller = gtk.ScrollerWindow()
|
||||
self.window.add(scroller)
|
||||
|
||||
self.web_view = webkit.WebView()
|
||||
|
||||
scroller = gtk.StrolledWindow()
|
||||
self.add(scroller)
|
||||
scroller.show()
|
||||
scroller.add(self.web_view)
|
||||
self.web_view.show()
|
||||
self.web_view.open("http://google.com")
|
||||
|
||||
def quit(self)
|
||||
self.hide_all()
|
||||
|
||||
def quit(self, widget, foo):
|
||||
self.window.hide()
|
||||
self.app.quit(self)
|
||||
|
||||
def show(self):
|
||||
self.window.show()
|
||||
|
||||
def hide(self):
|
||||
self.window.hide()
|
||||
|
|
Reference in a new issue