Refactoring and some bug fixes

This commit is contained in:
itdominator 2022-02-15 00:51:06 -06:00
parent e35ef4dcf7
commit ec24e5fada
12 changed files with 255 additions and 208 deletions

View File

@ -3,7 +3,7 @@ Name=Cornea
GenericName=A python screenshot application.
Comment=Take screenshots of your desktop.
Exec=<your_path>/screenshot
Icon=<your_path>/resources/cornea.png
Icon=/usr/share/cornea/cornea.png
Type=Application
StartupNotify=true
Categories=Utility;

20
src/__builtins__.py Normal file
View File

@ -0,0 +1,20 @@
import builtins
# Python imports
import builtins
# Lib imports
# Application imports
class Builtins:
"""Docstring for __builtins__ extender"""
def __init__(self):
pass
# NOTE: Just reminding myself we can add to builtins two different ways...
# __builtins__.update({"event_system": Builtins()})
builtins.app_name = "Cornea"

View File

@ -1,22 +1,17 @@
# Python imports
import inspect
from setproctitle import setproctitle
# Gtk imports
import gi, faulthandler, signal
gi.require_version('Gtk', '3.0')
# Lib imports
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib
# Application imports
from __builtins__ import Builtins
from utils import Settings, CrossClassSignals
from signal_classes import MainWindow, DrawingArea, MainMenuPopup
class Main:
class Main(Builtins):
def __init__(self, args):
settings = Settings()
builder = settings.returnBuilder()

View File

@ -5,10 +5,10 @@
import argparse
from setproctitle import setproctitle
# Gtk imports
# Lib imports
import gi, faulthandler, signal
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gtk
from gi.repository import GLib
# Application imports
@ -18,7 +18,7 @@ from __init__ import Main
if __name__ == "__main__":
try:
setproctitle('Cornea')
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, gtk.main_quit)
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, Gtk.main_quit)
faulthandler.enable() # For better debug info
parser = argparse.ArgumentParser()
# Add long and short arguments
@ -27,6 +27,6 @@ if __name__ == "__main__":
# Read arguments (If any...)
args = parser.parse_args()
main = Main(args)
gtk.main()
Gtk.main()
except Exception as e:
print( repr(e) )

View File

@ -1,18 +1,15 @@
# Gtk imports
import gi, cairo
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib as glib
# Python imports
import threading, html
import pyscreenshot as capture
# Lib imports
import gi, cairo
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
from gi.repository import GLib
# Application imports
@ -46,9 +43,9 @@ class DrawingArea:
self.regionWindow.set_keep_above(True)
self.DRAW_AREA = self.builder.get_object("selectionArea")
self.DRAW_AREA.add_events(gdk.EventMask.BUTTON_PRESS_MASK)
self.DRAW_AREA.add_events(gdk.EventMask.BUTTON_RELEASE_MASK)
self.DRAW_AREA.add_events(gdk.EventMask.BUTTON1_MOTION_MASK)
self.DRAW_AREA.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.DRAW_AREA.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK)
self.DRAW_AREA.add_events(Gdk.EventMask.BUTTON1_MOTION_MASK)
self.DRAW_AREA.connect("button-press-event", self.on_button_press)
self.DRAW_AREA.connect("button-release-event", self.on_button_release)
self.DRAW_AREA.connect("motion-notify-event", self.on_mouse_move)
@ -77,7 +74,7 @@ class DrawingArea:
def on_button_press(self, w, e):
self.messageLabel.set_markup("")
if e.type == gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.LEFT_BUTTON:
if e.type == Gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.LEFT_BUTTON:
self.coords[0] = [e.x, e.y]
self.regionMenu.hide()
@ -85,7 +82,7 @@ class DrawingArea:
if self.cr:
self.draw(self.cr, self.WIN_REC, self.BG_COLOR)
self.DRAW_AREA.queue_draw()
if e.type == gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.RIGHT_BUTTON:
if e.type == Gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.RIGHT_BUTTON:
self.regionMenu.show()
# Update second set of coords.
@ -95,24 +92,29 @@ class DrawingArea:
@threaded
def on_button_release(self, w, e):
if e.type == gdk.EventType.BUTTON_RELEASE and e.button == MouseButtons.LEFT_BUTTON:
glib.idle_add(self.regionMenu.show)
if e.type == Gdk.EventType.BUTTON_RELEASE and e.button == MouseButtons.LEFT_BUTTON:
GLib.idle_add(self.regionMenu.show)
@threaded
def grabRegion(self, widget):
glib.idle_add(self.regionMenu.hide)
glib.idle_add(self.mainWindow.hide)
self.boundingBoxGrab(self.rec[0], self.rec[1], self.rec[2], self.rec[3])
glib.idle_add(self.regionMenu.show)
glib.idle_add(self.mainWindow.show)
self.utilsClass.refereshDirectoryList()
GLib.idle_add(self.grabRegionIdle)
@threaded
def returnToMainWindow(self, widget):
glib.idle_add(self.regionWindow.hide)
glib.idle_add(self.regionMenu.hide)
glib.idle_add(self.mainWindow.show)
GLib.idle_add(self.returnToMainWindowIdle)
def grabRegionIdle(self):
self.mainWindow.hide()
self.regionMenu.hide()
self.boundingBoxGrab(self.rec[0], self.rec[1], self.rec[2], self.rec[3])
self.regionMenu.show()
self.mainWindow.show()
self.utilsClass.refereshDirectoryList()
def returnToMainWindowIdle(self):
self.regionWindow.hide()
self.regionMenu.hide()
self.mainWindow.show()
def on_draw(self, wid, cr):
@ -172,9 +174,9 @@ class DrawingArea:
self.utilsClass.boundingBoxGrab(x1, y1, x2, y2)
markup = "<span foreground='" + self.success + "'>Grabbed region successfully...</span>"
glib.idle_add(self.messageLabel.set_markup, markup)
GLib.idle_add(self.messageLabel.set_markup, markup)
except Exception as e:
print(e)
markup = "<span foreground='" + self.warning + "' >Oops...</span>" + \
"\n<span foreground='" + self.error + "'>" + html.escape( str(e) ) + "</span>"
glib.idle_add(self.messageLabel.set_markup, markup)
GLib.idle_add(self.messageLabel.set_markup, markup)

View File

@ -1,8 +1,9 @@
# Gtk imports
# Python imports
import os, subprocess
# lib imports
# Application imports

View File

@ -1,15 +1,14 @@
# Gtk imports
# Python imports
import threading, subprocess, os
import pyscreenshot as capture
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib as glib
# Python imports
import threading, subprocess, os
import pyscreenshot as capture
from gi.repository import Gtk as Gtk
from gi.repository import Gdk as Gdk
# Application imports
@ -78,9 +77,9 @@ class MainWindow:
def getActiveWindow(self):
self.utilsClass.sleep()
screen = gdk.get_default_root_window().get_screen()
screen = Gdk.get_default_root_window().get_screen()
w = screen.get_active_window()
pb = gdk.pixbuf_get_from_window(w, *w.get_geometry())
pb = Gdk.pixbuf_get_from_window(w, *w.get_geometry())
pb.savev(self.utilsClass.generateScreenshotName(), "png", (), ())
def snapshotMonitor(self):
@ -129,7 +128,7 @@ class MainWindow:
try:
if os.path.isfile(fullPath):
fileNameEntry.set_text(file)
pixbuf = gtk.Image.new_from_file(fullPath).get_pixbuf()
pixbuf = Gtk.Image.new_from_file(fullPath).get_pixbuf()
scaledPixBuf = pixbuf.scale_simple(480, 320, 2) # 2 = BILINEAR and is best by default
imageView.set_from_pixbuf(scaledPixBuf)
except Exception as e:
@ -146,8 +145,8 @@ class MainWindow:
return active_radio
def showMainMenu(self, w, e):
if e.type == gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.RIGHT_BUTTON:
if e.type == Gdk.EventType.BUTTON_PRESS and e.button == MouseButtons.RIGHT_BUTTON:
self.builder.get_object("mainMenu").popup()
def close(self, widget):
gtk.main_quit()
Gtk.main_quit()

View File

@ -1,11 +1,11 @@
# Gtk imports
from gi.repository import GLib as glib
# Python imports
import os, threading, time, datetime
# Lib imports
from gi.repository import GLib
import pyscreenshot as capture
# Application imports
@ -40,7 +40,7 @@ class CrossClassSignals:
if len(images) != len(self.fileStore):
self.fileStore.clear()
for image in images:
glib.idle_add(self.addToStore, (image))
GLib.idle_add(self.addToStore, (image))
# self.fileStore.sort()
self.refreshingState = False

View File

@ -1,36 +1,52 @@
# Gtk imports
# Python imports
import os
# Lib imports
import gi, cairo
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import Gtk
from gi.repository import Gdk
# Python imports
import os
# Application imports
class Settings:
def __init__(self):
self.SCRIPT_PTH = os.path.dirname(os.path.realpath(__file__)) + "/"
self.builder = gtk.Builder()
self.builder.add_from_file(self.SCRIPT_PTH + "../resources/Main_Window.glade")
self._SCRIPT_PTH = os.path.dirname(os.path.realpath(__file__))
self._USER_HOME = os.path.expanduser('~')
self._CONFIG_PATH = f"{self._USER_HOME}/.config/{app_name.lower()}"
self._GLADE_FILE = f"{self._CONFIG_PATH}/Main_Window.glade"
self._CSS_FILE = f"{self._CONFIG_PATH}/stylesheet.css"
self._DEFAULT_ICONS = f"{self._CONFIG_PATH}/icons"
self._WINDOW_ICON = f"{self._DEFAULT_ICONS}/{app_name.lower()}.png"
self._USR_PATH = f"/usr/share/{app_name.lower()}"
self.SCREENSHOTS_DIR = f"{self._USER_HOME}/.screenshots"
if not os.path.exists(self._CONFIG_PATH):
os.mkdir(self._CONFIG_PATH)
if not os.path.exists(self._GLADE_FILE):
self._GLADE_FILE = f"{self._USR_PATH}/Main_Window.glade"
if not os.path.exists(self._CSS_FILE):
self._CSS_FILE = f"{self._USR_PATH}/stylesheet.css"
if not os.path.exists(self._WINDOW_ICON):
self._WINDOW_ICON = f"{self._USR_PATH}/icons/{app_name.lower()}.png"
if not os.path.isdir(self.SCREENSHOTS_DIR):
os.mkdir(self.SCREENSHOTS_DIR)
# 'Filters'
self.images = ('.png', '.jpg', '.jpeg', '.gif')
HOME_PATH = os.path.expanduser('~')
self.SCREENSHOTS_DIR = HOME_PATH + "/" + ".screenshots"
if not os.path.isdir(self.SCREENSHOTS_DIR):
os.mkdir(self.SCREENSHOTS_DIR)
self.builder = Gtk.Builder()
self.builder.add_from_file(self._GLADE_FILE)
def createWindow(self):
# Get window and connect signals
window = self.builder.get_object("Main_Window")
window.connect("delete-event", gtk.main_quit)
window.connect("delete-event", Gtk.main_quit)
self.setWindowData(window)
return window
@ -42,17 +58,17 @@ class Settings:
window.set_visual(visual)
# bind css file
cssProvider = gtk.CssProvider()
cssProvider.load_from_path(self.SCRIPT_PTH + '../resources/stylesheet.css')
screen = gdk.Screen.get_default()
styleContext = gtk.StyleContext()
styleContext.add_provider_for_screen(screen, cssProvider, gtk.STYLE_PROVIDER_PRIORITY_USER)
cssProvider = Gtk.CssProvider()
cssProvider.load_from_path(self._CSS_FILE)
screen = Gdk.Screen.get_default()
styleContext = Gtk.StyleContext()
styleContext.add_provider_for_screen(screen, cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
def getMonitorData(self):
screen = self.builder.get_object("Main_Window").get_screen()
wdth = screen.get_width()
hght = screen.get_height()
mon0 = gdk.Rectangle()
mon0 = Gdk.Rectangle()
mon0.width = wdth
mon0.height = hght
monitors = []

View File

@ -1,26 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="Region_Window">
<property name="can_focus">False</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
<property name="can-focus">False</property>
<property name="skip-taskbar-hint">True</property>
<property name="skip-pager-hint">True</property>
<property name="decorated">False</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkDrawingArea" id="selectionArea">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">True</property>
@ -42,37 +39,34 @@
</object>
<object class="GtkImage" id="grabRegionImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="stock">gtk-copy</property>
</object>
<object class="GtkWindow" id="regionMenu">
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="type">popup</property>
<property name="window_position">mouse</property>
<property name="type_hint">menu</property>
<property name="window-position">mouse</property>
<property name="type-hint">menu</property>
<property name="decorated">False</property>
<property name="gravity">north-east</property>
<child>
<placeholder/>
</child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Grab Region</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">grabRegionImage</property>
<property name="always_show_image">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="grabRegion" swapped="no"/>
</object>
<packing>
@ -85,10 +79,10 @@
<object class="GtkButton">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="returnToMainWindow" swapped="no"/>
</object>
<packing>
@ -107,7 +101,7 @@
<child>
<object class="GtkLabel" id="messageLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">True</property>
@ -126,58 +120,55 @@
</object>
<object class="GtkImage" id="picImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="stock">gtk-cancel</property>
</object>
<object class="GtkImage" id="renameImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="stock">gtk-edit</property>
</object>
<object class="GtkImage" id="revertImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="stock">gtk-undo</property>
</object>
<object class="GtkAdjustment" id="timeoutAdjustment">
<property name="upper">60</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkWindow" id="Main_Window">
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes">Cornea</property>
<property name="window_position">center</property>
<property name="default_width">500</property>
<property name="default_height">310</property>
<property name="icon">pyCornea.png</property>
<property name="window-position">center</property>
<property name="default-width">500</property>
<property name="default-height">310</property>
<property name="icon">cornea.png</property>
<property name="gravity">center</property>
<child>
<placeholder/>
</child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkRadioButton" id="entireScrnToggle">
<property name="label" translatable="yes">Entire screen</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Take a screenshot of the entire screen.</property>
<property name="margin_bottom">5</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Take a screenshot of the entire screen.</property>
<property name="margin-bottom">5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="toggleRadioBttn" swapped="no"/>
</object>
<packing>
@ -190,13 +181,13 @@
<object class="GtkRadioButton" id="windowToggle">
<property name="label" translatable="yes">Active window</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Take a screenshot of the active window.</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Take a screenshot of the active window.</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="draw-indicator">True</property>
<property name="group">entireScrnToggle</property>
<signal name="toggled" handler="toggleRadioBttn" swapped="no"/>
</object>
@ -210,13 +201,13 @@
<object class="GtkRadioButton" id="regionToggle">
<property name="label" translatable="yes">Select a region</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Select a region to be captured by clicking a point of the screen without releasing the mouse, dragging you mouse to the other corner of the region, and releasing the mouse button.</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Select a region to be captured by clicking a point of the screen without releasing the mouse, dragging you mouse to the other corner of the region, and releasing the mouse button.</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="draw-indicator">True</property>
<property name="group">entireScrnToggle</property>
<signal name="toggled" handler="toggleRadioBttn" swapped="no"/>
</object>
@ -230,13 +221,13 @@
<object class="GtkRadioButton" id="monitorToggle">
<property name="label" translatable="yes">Select a monitor</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Take a screenshot of the selected monitor.</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Take a screenshot of the selected monitor.</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="draw-indicator">True</property>
<property name="group">entireScrnToggle</property>
<signal name="toggled" handler="toggleRadioBttn" swapped="no"/>
</object>
@ -256,13 +247,18 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Timeout</property>
<property name="justify">right</property>
</object>
@ -275,11 +271,11 @@
<child>
<object class="GtkSpinButton" id="delayAmount">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Delay in seconds before the screenshot is taken.</property>
<property name="input_purpose">number</property>
<property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Delay in seconds before the screenshot is taken.</property>
<property name="input-purpose">number</property>
<property name="adjustment">timeoutAdjustment</property>
<property name="snap_to_ticks">True</property>
<property name="snap-to-ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
@ -289,6 +285,24 @@
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="popup_bind_area">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
@ -297,16 +311,16 @@
</child>
<child>
<object class="GtkAspectFrame" id="previewPane">
<property name="width_request">312</property>
<property name="height_request">312</property>
<property name="width-request">312</property>
<property name="height-request">312</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<property name="can-focus">False</property>
<property name="label-xalign">0</property>
<property name="shadow-type">none</property>
<child>
<object class="GtkImage" id="imageView">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
</child>
@ -327,16 +341,16 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton" id="snapshotBttn">
<property name="label" translatable="yes">Take Snapshot</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">picImage</property>
<property name="always_show_image">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="take_screenshot" swapped="no"/>
</object>
<packing>
@ -349,9 +363,9 @@
<object class="GtkTreeView" id="monitorsView">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="model">monitorStore</property>
<property name="headers_clickable">False</property>
<property name="headers-clickable">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@ -375,17 +389,17 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="width_request">200</property>
<property name="width-request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_top">15</property>
<property name="shadow_type">in</property>
<property name="can-focus">True</property>
<property name="margin-top">15</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="model">fileStore</property>
<property name="headers_clickable">False</property>
<property name="headers-clickable">False</property>
<signal name="button-press-event" handler="showMainMenu" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection">
@ -396,7 +410,7 @@
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Images</property>
<property name="clickable">True</property>
<property name="sort_order">descending</property>
<property name="sort-order">descending</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -418,10 +432,10 @@
<object class="GtkButton">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="close" swapped="no"/>
</object>
<packing>
@ -441,25 +455,25 @@
</child>
</object>
<object class="GtkPopover" id="mainMenu">
<property name="width_request">320</property>
<property name="height_request">150</property>
<property name="can_focus">False</property>
<property name="relative_to">delayAmount</property>
<property name="width-request">320</property>
<property name="height-request">150</property>
<property name="can-focus">False</property>
<property name="relative-to">popup_bind_area</property>
<signal name="grab-focus" handler="setBackupVar" swapped="no"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkEntry" id="fileNameEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
</object>
<packing>
<property name="expand">True</property>
@ -471,10 +485,10 @@
<object class="GtkButton">
<property name="label" translatable="yes">Revert</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">revertImage</property>
<property name="always_show_image">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="resetName" swapped="no"/>
</object>
<packing>
@ -494,10 +508,10 @@
<object class="GtkButton">
<property name="label" translatable="yes">Rename</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">renameImage</property>
<property name="always_show_image">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="renameFile" swapped="no"/>
</object>
<packing>
@ -510,10 +524,10 @@
<object class="GtkButton">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="openFile" swapped="no"/>
</object>
<packing>
@ -526,10 +540,10 @@
<object class="GtkButton">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<property name="always-show-image">True</property>
<signal name="clicked" handler="deleteFile" swapped="no"/>
</object>
<packing>

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB