fixed Preference window look
This commit is contained in:
parent
f9b138f66b
commit
36f2e9add1
2 changed files with 62 additions and 27 deletions
|
@ -1,20 +1,23 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from gi.repository import Gtk
|
import gtk
|
||||||
import TentiaWindows
|
import TentiaWindows
|
||||||
|
|
||||||
class Tentia:
|
class Tentia:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.setup_preferences_window()
|
self.setup_preferences_window()
|
||||||
self.preferences_window.show_all()
|
self.preferences_window.show()
|
||||||
Gtk.main()
|
gtk.main()
|
||||||
|
|
||||||
def quit(self):
|
def quit(self, sender):
|
||||||
Gtk.main_quit()
|
gtk.main_quit()
|
||||||
|
|
||||||
def setup_preferences_window(self):
|
def setup_preferences_window(self):
|
||||||
self.preferences_window = TentiaWindows.Preferences(self)
|
self.preferences_window = TentiaWindows.Preferences(self)
|
||||||
|
|
||||||
|
def resources_path(self):
|
||||||
|
return "../"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
Tentia()
|
Tentia()
|
|
@ -1,41 +1,73 @@
|
||||||
from gi.repository import Gtk
|
import gtk, webkit
|
||||||
import webkit
|
|
||||||
|
|
||||||
class Preferences(Gtk.Window):
|
class Preferences:
|
||||||
|
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
|
|
||||||
self.app = app
|
self.app = app
|
||||||
Gtk.Window.__init__(self, title="Preferences")
|
self.window = gtk.Window()
|
||||||
self.connect("delete-event", self.quit)
|
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.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.window.show_all()
|
||||||
self.hide_all()
|
self.window.hide()
|
||||||
|
|
||||||
|
def quit(self, wiget, foo):
|
||||||
|
self.window.hide()
|
||||||
self.app.quit(self)
|
self.app.quit(self)
|
||||||
|
|
||||||
def on_login_button_clicked(self, widget):
|
def on_login_button_clicked(self, widget):
|
||||||
print "Login"
|
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
|
self.app = app
|
||||||
Gtk.Window.__init__(self, title="Tentia")
|
self.window = gtk.Window()
|
||||||
self.connect("delete-event", self.quit)
|
self.window.connect("delete-event", self.quit)
|
||||||
|
|
||||||
|
scroller = gtk.ScrollerWindow()
|
||||||
|
self.window.add(scroller)
|
||||||
|
|
||||||
self.web_view = webkit.WebView()
|
self.web_view = webkit.WebView()
|
||||||
|
|
||||||
scroller = gtk.StrolledWindow()
|
|
||||||
self.add(scroller)
|
|
||||||
scroller.show()
|
|
||||||
scroller.add(self.web_view)
|
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)
|
self.app.quit(self)
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
self.window.show()
|
||||||
|
|
||||||
|
def hide(self):
|
||||||
|
self.window.hide()
|
||||||
|
|
Reference in a new issue