Skip to content

Commit 0d90290

Browse files
committed
[WIP] Adding of screenshot panel for screenshots on pressing Alt 1 or PrtSc
1 parent a83257b commit 0d90290

File tree

5 files changed

+363
-5
lines changed

5 files changed

+363
-5
lines changed

extensions/deviceicon/display.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from jarabe.frame.frameinvoker import FrameWidgetInvoker
3434
from jarabe.model import brightness
35-
from jarabe.model.screenshot import take_screenshot
35+
from jarabe.view.screenshotpopup import ScreenshotPanel
3636
from jarabe import frame
3737

3838

@@ -90,7 +90,7 @@ def __init__(self, text, icon_name):
9090
icon = Icon(pixel_size=style.SMALL_ICON_SIZE)
9191
icon.props.icon_name = icon_name
9292
icon.props.xo_color = XoColor('%s,%s' % (style.COLOR_WHITE.get_svg(),
93-
style.COLOR_BUTTON_GREY.get_svg()))
93+
style.COLOR_BUTTON_GREY.get_svg()))
9494
icon.show()
9595

9696
label = Gtk.Label(text)
@@ -228,7 +228,7 @@ def __screenshot_cb(self, palette):
228228
def __take_screenshot_cb(self, frame_):
229229
if frame_.is_visible():
230230
return True
231-
take_screenshot()
231+
panel = ScreenshotPanel()
232232
frame_.show()
233233
return False
234234

extensions/globalkey/screenshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
from jarabe.model.screenshot import take_screenshot
17+
from jarabe.view.screenshotpopup import ScreenshotPanel
1818

1919
BOUND_KEYS = ['<alt>1', 'Print']
2020

2121

2222
def handle_key_press(key):
23-
take_screenshot()
23+
panel = ScreenshotPanel()

src/jarabe/desktop/activitychooser.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333

3434

3535
class TitleBox(Gtk.Toolbar):
36+
'''
37+
Title box at the top of the pop-up window.
38+
Title and close button are added to the box and as needed
39+
more widgets can be added using self.add_widget method.
40+
This box is optional as the inherited class can remove this
41+
block by setting the self._set_title_box to False.
42+
'''
43+
3644
def __init__(self):
3745
Gtk.Toolbar.__init__(self)
3846

@@ -52,9 +60,16 @@ def __init__(self):
5260
tool_item.show()
5361

5462
def set_title(self, title):
63+
'''
64+
setter function for 'title' property.
65+
Args:
66+
title (str): title for pop-up window
67+
'''
5568
self._label.set_markup('<b>%s</b>' % title)
5669
self._label.show()
5770

71+
title = GObject.Property(type=str, setter=set_title)
72+
5873

5974
_AUTOSEARCH_TIMEOUT = 1000
6075

@@ -149,6 +164,17 @@ def __init__(self):
149164

150165
self.show()
151166

167+
def get_title_box(self):
168+
'''
169+
Getter method for title-box
170+
171+
Returns:
172+
self._title_box (): Title or Tool Box
173+
'''
174+
return self._title_box
175+
176+
title_box = GObject.Property(type=str, getter=get_title_box)
177+
152178
def __close_button_clicked_cb(self, button):
153179
self.destroy()
154180

src/jarabe/view/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sugar_PYTHON = \
1111
launcher.py \
1212
palettes.py \
1313
pulsingicon.py \
14+
screenshotpopup.py \
1415
service.py \
1516
tabbinghandler.py \
1617
viewsource.py \

0 commit comments

Comments
 (0)