Merge lp:~bdfhjk/clicompanion/fix-684336 into lp:clicompanion

Proposed by Marek Bardoński
Status: Merged
Approved by: Duane Hinnen
Approved revision: 72
Merged at revision: 71
Proposed branch: lp:~bdfhjk/clicompanion/fix-684336
Merge into: lp:clicompanion
Diff against target: 78 lines (+21/-11)
2 files modified
clicompanionlib/tabs.py (+6/-1)
clicompanionlib/view.py (+15/-10)
To merge this branch: bzr merge lp:~bdfhjk/clicompanion/fix-684336
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+54162@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Duane Hinnen (duanedesign) wrote :

Look at the TODO: on line 145 of view.py.
I added that awhile back and thought it might be able to be used to fix this issue.
What do you think?
Do you think either solution has any advantage?
Thank you for your work on this.
Good Job!

review: Needs Information
Revision history for this message
Marek Bardoński (bardonski) wrote :

I look at this for about 2h

Revision history for this message
Marek Bardoński (bdfhjk) wrote :

I look at this for about 2h

Revision history for this message
Marek Bardoński (bdfhjk) wrote :

'''I will check it in two hours

lp:~bdfhjk/clicompanion/fix-684336 updated
72. By bdfhjk

better resolution get

Revision history for this message
Marek Bardoński (bdfhjk) wrote :

Yes.

I used it now.

Revision history for this message
Duane Hinnen (duanedesign) wrote :

Good job, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clicompanionlib/tabs.py'
2--- clicompanionlib/tabs.py 2011-03-02 12:20:09 +0000
3+++ clicompanionlib/tabs.py 2011-03-21 16:58:25 +0000
4@@ -26,6 +26,7 @@
5
6 from clicompanionlib.utils import get_user_shell
7 import clicompanionlib.controller
8+import view
9
10 CONFIGFILE = os.path.expanduser("~/.config/clicompanion/config")
11 gcp=0;
12@@ -36,7 +37,11 @@
13 '''
14 def add_tab(self,widget, notebook):
15 _vte = vte.Terminal()
16- _vte.set_size_request(700, 220)
17+ if view.NETBOOKMODE == 1:
18+ _vte.set_size_request(700, 120)
19+ else:
20+ _vte.set_size_request(700, 220)
21+
22 _vte.connect ("child-exited", lambda term: gtk.main_quit())
23 _vte.fork_command(get_user_shell()) # Get the user's default shell
24
25
26=== modified file 'clicompanionlib/view.py'
27--- clicompanionlib/view.py 2011-03-21 12:43:08 +0000
28+++ clicompanionlib/view.py 2011-03-21 16:58:25 +0000
29@@ -62,11 +62,17 @@
30 ('STRING', 0, 3),
31 ]
32 FILTER = 0
33+NETBOOKMODE = 0
34
35
36 class MainWindow():
37 liststore = gtk.ListStore(str, str, str)
38-
39+ screen = gtk.gdk.display_get_default().get_default_screen()
40+ screen_size = screen.get_monitor_geometry(0)
41+ height = screen.get_height() ## screen height ##
42+ global NETBOOKMODE
43+ if height < 750:
44+ NETBOOKMODE = 1
45 ## open file containing command list and put it in a variable
46 def update(self, liststore):
47 try:
48@@ -140,13 +146,6 @@
49 ##create the config file
50 conf_mod = Config()
51 conf_mod.create_config()
52-
53-
54- #TODO: do we want to do this? Or just keep the height under 600.
55- ##Get user screen size##
56- #screen = gtk.gdk.display_get_default().get_default_screen()
57- #screen_size = screen.get_monitor_geometry(0)
58- #height = screen.get_height() ## screen height ##
59
60 ## Create UI widgets
61 window = gtk.Window(gtk.WINDOW_TOPLEVEL)
62@@ -157,8 +156,14 @@
63 notebook = gtk.Notebook()
64
65 ## set sizes and borders
66- scrolledwindow.set_size_request(700, 220)
67- window.set_default_size(700, 625)
68+
69+ global NETBOOKMODE
70+ if NETBOOKMODE == 1:
71+ scrolledwindow.set_size_request(700, 200)
72+ window.set_default_size(700, 500)
73+ else:
74+ scrolledwindow.set_size_request(700, 220)
75+ window.set_default_size(700, 625)
76 window.set_border_width(10)
77 ## Sets the position of the window relative to the screen
78 window.set_position(gtk.WIN_POS_CENTER_ALWAYS)

Subscribers

People subscribed via source and target branches