Changeset 3054
- Timestamp:
- 06/29/08 09:24:27 (5 years ago)
- Location:
- branch/PreferencesWindow/umitPreferences
- Files:
-
- 2 modified
-
PreviewWindow.py (modified) (6 diffs)
-
TabsWidget.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branch/PreferencesWindow/umitPreferences/PreviewWindow.py
r3053 r3054 23 23 import gobject 24 24 import cairo 25 import pango 25 26 26 27 … … 41 42 - Hide ToolBar 42 43 - Hide ListPorts 43 - Hide Nmap Results44 1- Hide Nmap Results 44 45 45 46 """ … … 53 54 """ Constructor of Preview Widget """ 54 55 gtk.EventBox.__init__(self) 55 56 self.box = gtk.VBox() 57 self.add(self.box) 56 self.__text_color = True 57 58 58 59 59 … … 70 70 y = alloc.y 71 71 height = alloc.height 72 height = height-height/10 72 73 width = alloc.width 73 74 … … 140 141 141 142 # Up Horizontal line 142 cr.move_to(w_tmp , h_tmp_up-height/25)143 cr.move_to(w_tmp+width/30, h_tmp_up-height/25) 143 144 cr.line_to(w_tmp+width/7, h_tmp_up-height/25) 144 145 145 146 147 146 cr.stroke() 147 self.draw_text(cr,w_tmp, h_tmp_down, width, height) 148 149 150 151 152 153 def change_color(self, cr, w, h): 154 try: 155 cr.rectangle(0, h-h/30, w, h) 156 cr.set_source_rgba(0.8,0.8,0.8,0.8) 157 cr.fill() 158 cr.move_to(0, h-h/30) 159 self.__text_color = not self.__text_color 160 if (self.__text_color): 161 cr.set_source_rgb(0,0.3,1) 162 else: 163 cr.set_source_rgb(1,1.0,1) 164 self._layout.context_changed() 165 cr.update_layout(self._layout) 166 cr.show_layout(self._layout) 167 return True 168 except cairo.Error, e: 169 return False 170 print e 171 pass 172 173 174 175 176 def draw_text(self, cr, w_tmp, h_tmp_down, width, height): 177 ############# Text ################## 178 print "draw text" 179 180 cr.set_source_rgba(0,0.3,1,0.5) 181 182 183 cr.move_to(w_tmp+width/30, h_tmp_down+height/30) 184 self._layout = self.create_pango_layout('General') 185 self._layout.set_font_description(pango.FontDescription(\ 186 "Sans Serif 16")) 187 cr.update_layout(self._layout) 188 cr.show_layout(self._layout) 189 gobject.timeout_add(300, self.change_color, cr, width, height) 190 191 self.change_color(cr, width, height) 148 192 149 193 def press_toolbar(self): … … 152 196 """ 153 197 154 198 # Get sizes and allocate 199 alloc = self.allocation 200 x = alloc.x 201 y = alloc.y 202 height = alloc.height 203 width = alloc.width 204 155 205 def press_nmap_results(self): 156 206 """ 157 207 Verify if nmap results was pressed 158 208 """ 159 160 161 209 # Get sizes and allocate 210 alloc = self.allocation 211 x = alloc.x 212 y = alloc.y 213 height = alloc.height 214 width = alloc.width 215 216 162 217 def do_button_press_event(self, event): 163 218 print "press" -
branch/PreferencesWindow/umitPreferences/TabsWidget.py
r3048 r3054 140 140 141 141 142 #### Should be replace IconView implementation #### 143 """ 144 145 TabWidget is a widget similar like tabs of firefox 146 147 Depends: cairo 148 149 """ 150 class TabWidget(gtk.EventBox): 151 def __init__(self): 152 pass 153 154 155 156 157
