Popup window template started
This commit is contained in:
parent
2904e14d3f
commit
cdf9dfd379
@ -31,19 +31,13 @@ class Controller:
|
|||||||
newPath = widget.get_filename()
|
newPath = widget.get_filename()
|
||||||
Grid(self.desktop, self.settings, newPath)
|
Grid(self.desktop, self.settings, newPath)
|
||||||
|
|
||||||
|
|
||||||
def getWindowsOnScreen(self):
|
def getWindowsOnScreen(self):
|
||||||
screen = self.settings.returnScren()
|
screen = self.settings.returnScren()
|
||||||
windowButtons = self.builder.get_object("windowButtons")
|
windowButtons = self.builder.get_object("windowButtons")
|
||||||
|
|
||||||
|
|
||||||
|
def closePopup(self, widget, data=None):
|
||||||
|
widget.hide()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# File control events
|
# File control events
|
||||||
@ -69,6 +63,7 @@ class Controller:
|
|||||||
def pasteFile(self):
|
def pasteFile(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Webview events
|
# Webview events
|
||||||
def showWebview(self, widget):
|
def showWebview(self, widget):
|
||||||
self.builder.get_object("webViewer").popup()
|
self.builder.get_object("webViewer").popup()
|
||||||
|
@ -8,132 +8,15 @@
|
|||||||
<mime-type>inode/directory</mime-type>
|
<mime-type>inode/directory</mime-type>
|
||||||
</mime-types>
|
</mime-types>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkImage" id="webDropDown">
|
<object class="GtkWindow" id="iconControlsWindow">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="tooltip_text" translatable="yes">Show Mini Webbrowser</property>
|
<property name="resizable">False</property>
|
||||||
<property name="stock">gtk-go-down</property>
|
<property name="modal">True</property>
|
||||||
<property name="icon_size">3</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkWindow" id="Window">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="default_width">800</property>
|
|
||||||
<property name="default_height">600</property>
|
|
||||||
<property name="type_hint">desktop</property>
|
|
||||||
<property name="decorated">False</property>
|
<property name="decorated">False</property>
|
||||||
<property name="gravity">center</property>
|
<signal name="focus-out-event" handler="closePopup" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box1">
|
|
||||||
<property name="width_request">256</property>
|
|
||||||
<property name="visible">True</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>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="popOutBttn">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="image">webDropDown</property>
|
|
||||||
<property name="always_show_image">True</property>
|
|
||||||
<signal name="clicked" handler="showWebview" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkFileChooserButton" id="selectedDirDialog">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="action">select-folder</property>
|
|
||||||
<property name="filter">Folders</property>
|
|
||||||
<property name="title" translatable="yes">Directory Chooser</property>
|
|
||||||
<signal name="file-set" handler="setIconViewDir" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSearchEntry" id="searDir">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
|
||||||
<property name="primary_icon_activatable">False</property>
|
|
||||||
<property name="primary_icon_sensitive">False</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkIconView" id="Desktop">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="margin">6</property>
|
|
||||||
<property name="selection_mode">multiple</property>
|
|
||||||
<property name="columns">6</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="windowButtons">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<object class="GtkPopover" id="iconControlsWindow">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="relative_to">popOutBttn</property>
|
|
||||||
<property name="position">bottom</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -229,6 +112,132 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkImage" id="webDropDown">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Show Mini Webbrowser</property>
|
||||||
|
<property name="stock">gtk-go-down</property>
|
||||||
|
<property name="icon_size">3</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkWindow" id="Window">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="default_width">800</property>
|
||||||
|
<property name="default_height">600</property>
|
||||||
|
<property name="type_hint">desktop</property>
|
||||||
|
<property name="decorated">False</property>
|
||||||
|
<property name="gravity">center</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box1">
|
||||||
|
<property name="width_request">256</property>
|
||||||
|
<property name="visible">True</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>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="popOutBttn">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="image">webDropDown</property>
|
||||||
|
<property name="always_show_image">True</property>
|
||||||
|
<signal name="clicked" handler="showWebview" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFileChooserButton" id="selectedDirDialog">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="action">select-folder</property>
|
||||||
|
<property name="filter">Folders</property>
|
||||||
|
<property name="title" translatable="yes">Directory Chooser</property>
|
||||||
|
<signal name="file-set" handler="setIconViewDir" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="searDir">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="primary_icon_name">edit-find-symbolic</property>
|
||||||
|
<property name="primary_icon_activatable">False</property>
|
||||||
|
<property name="primary_icon_sensitive">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuButton" id="controlsBttn">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="focus_on_click">False</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="relief">none</property>
|
||||||
|
<property name="use_popover">False</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkIconView" id="Desktop">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="margin">6</property>
|
||||||
|
<property name="selection_mode">multiple</property>
|
||||||
|
<property name="columns">6</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
<object class="GtkPopover" id="webViewer">
|
<object class="GtkPopover" id="webViewer">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
|
@ -140,6 +140,7 @@ class Grid:
|
|||||||
# print(data)
|
# print(data)
|
||||||
|
|
||||||
def iconLeftClickEventManager(self, widget, item):
|
def iconLeftClickEventManager(self, widget, item):
|
||||||
|
print(item)
|
||||||
try:
|
try:
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
fileName = model[item][1]
|
fileName = model[item][1]
|
||||||
@ -160,27 +161,33 @@ class Grid:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
def iconRightClickEventManager(self, widget, eve, params):
|
def iconRightClickEventManager(self, widget, eve, rclicked_icon):
|
||||||
try:
|
try:
|
||||||
if eve.type == gdk.EventType.BUTTON_PRESS and eve.button == 3:
|
if eve.type == gdk.EventType.BUTTON_PRESS and eve.button == 3:
|
||||||
popover = self.builder.get_object("iconControlsWindow")
|
input = self.builder.get_object("iconRenameInput")
|
||||||
popover.show_all()
|
controls = self.builder.get_object("iconControlsWindow")
|
||||||
popover.popup()
|
items = widget.get_selected_items()
|
||||||
# # NOTE: Need to change name of listview box...
|
model = widget.get_model()
|
||||||
# children = widget.get_children()[0].get_children()
|
|
||||||
# fileName = children[1].get_text()
|
if len(items) == 1:
|
||||||
# dir = self.currentPath
|
fileName = model[items[0]][1]
|
||||||
# file = dir + "/" + fileName
|
dir = self.currentPath
|
||||||
#
|
file = dir + "/" + fileName
|
||||||
# input = self.builder.get_object("iconRenameInput")
|
|
||||||
# popover = self.builder.get_object("iconControlsWindow")
|
self.selectedFile = file # Used for return to caller
|
||||||
# self.selectedFile = file # Used for return to caller
|
input.set_text(fileName)
|
||||||
#
|
controls.show_all()
|
||||||
# input.set_text(fileName)
|
if len(items) > 1:
|
||||||
# popover.set_relative_to(widget)
|
dir = self.currentPath
|
||||||
# popover.set_position(gtk.PositionType.RIGHT)
|
for item in items:
|
||||||
# popover.show_all()
|
fileName = model[item][1]
|
||||||
# popover.popup()
|
file = dir + "/" + fileName
|
||||||
|
print(file)
|
||||||
|
|
||||||
|
input.set_text("")
|
||||||
|
input.hide()
|
||||||
|
controls.show()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user