Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Few visual improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Feb 27, 2017
1 parent 789fd40 commit 3b98556
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nautilus-git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def get_real_git_dir(directory):
git_folder = path.join(current_path, ".git")
if path.exists(git_folder):
return current_path
break
return None

def execute(cmd, cd=None):
Expand Down Expand Up @@ -210,11 +209,8 @@ def _build_widgets(self):
grid = self._build_status_widget(status)
container.attach(grid, 2, 0, 1, 1)


icon = Gio.ThemedIcon(name="open-menu-symbolic")
image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
button = Gtk.Button()
button.set_image(image)
button.set_label(_("More..."))
button.show()
self._generate_popover(button)
button.connect("clicked", self._trigger_popover)
Expand Down Expand Up @@ -251,13 +247,13 @@ def _trigger_popover(self, popover):
def _generate_popover(self, widget):
self._popover = Gtk.Popover()
self._popover.set_border_width(12)
self._popover.props.margin = 20
self._popover.set_relative_to(widget)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
box.show()
remote_button = Gtk.Button()
remote_button.set_halign(Gtk.Align.START)
remote_button.set_label(_("Open remote URL"))

remote_button.get_style_context().add_class("flat")
remote_url = self._git.get_remote_url()
remote_button.connect("clicked", self._open_remote_browser, remote_url)
if remote_url.lower().startswith(("http://", "https://", "wwww")):
Expand All @@ -267,6 +263,8 @@ def _generate_popover(self, widget):
files = self._git.get_modified()

self._diff_button = Gtk.Button()
self._diff_button.set_halign(Gtk.Align.START)
self._diff_button.get_style_context().add_class("flat")
self._diff_button.set_label(_("Compare commits"))
self._diff_button.connect("clicked", self._compare_commits)
if len(files) > 0:
Expand Down

0 comments on commit 3b98556

Please sign in to comment.