Commit 71bff874 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Move to Handy.ApplicationWindow

parent ce8f22da
Pipeline #214436 canceled with stage
in 4 minutes and 50 seconds
......@@ -200,11 +200,6 @@
<default>false</default>
<summary>Use dark GTK theme</summary>
<description></description>
</key>
<key type="b" name="disable-csd">
<default>false</default>
<summary>Disable use of client side window decorations (headerbar)</summary>
<description></description>
</key>
<key type="b" name="disable-scrobbling">
<default>false</default>
......
......@@ -14,7 +14,6 @@ from gi.repository import Gdk, GLib, Gio
from gettext import gettext as _
from lollypop.define import App, ArtSize, Notifications
from lollypop.utils import is_gnome
class NotificationManager:
......@@ -27,7 +26,6 @@ class NotificationManager:
Init notification object with lollypop infos
"""
self.__notification_timeout_id = None
self.__is_gnome = is_gnome()
App().player.connect("current-changed", self.__on_current_changed)
self.__notification = Gio.Notification.new("")
self.__action = Gio.Notification.new("")
......
......@@ -10,7 +10,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk, GLib
from gi.repository import Gtk, GLib, Handy
from lollypop.define import App, Size
from lollypop.toolbar_playback import ToolbarPlayback
......@@ -22,7 +22,7 @@ from lollypop.helper_size_allocation import SizeAllocationHelper
from lollypop.helper_signals import SignalsHelper, signals
class Toolbar(Gtk.HeaderBar, SizeAllocationHelper, SignalsHelper):
class Toolbar(Handy.HeaderBar, SizeAllocationHelper, SignalsHelper):
"""
Lollypop toolbar
"""
......
......@@ -318,20 +318,6 @@ def get_iso_date_from_string(string):
return None
def is_unity():
"""
Return True if desktop is Unity
"""
return GLib.getenv("XDG_CURRENT_DESKTOP") == "Unity"
def is_gnome():
"""
Return True if desktop is Gnome
"""
return GLib.getenv("XDG_CURRENT_DESKTOP") in ["ubuntu:GNOME", "GNOME"]
def format_artist_name(name):
"""
Return formated artist name
......
......@@ -10,17 +10,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk, GLib
from gi.repository import Gtk, GLib, Handy
from lollypop.define import App, ScanType
from lollypop.container import Container
from lollypop.toolbar import Toolbar
from lollypop.utils import is_unity, emit_signal
from lollypop.utils import emit_signal
from lollypop.helper_signals import SignalsHelper, signals_map
from lollypop.logger import Logger
class Window(Gtk.ApplicationWindow, SignalsHelper):
class Window(Handy.ApplicationWindow, SignalsHelper):
"""
Main window
"""
......@@ -30,10 +30,10 @@ class Window(Gtk.ApplicationWindow, SignalsHelper):
"""
Init window
"""
Gtk.ApplicationWindow.__init__(self,
application=App(),
title="Lollypop",
icon_name="org.gnome.Lollypop")
Handy.ApplicationWindow.__init__(self,
application=App(),
title="Lollypop",
icon_name="org.gnome.Lollypop")
self.__miniplayer = None
self.__configure_timeout_id = None
self.set_auto_startup_notification(False)
......@@ -59,12 +59,8 @@ class Window(Gtk.ApplicationWindow, SignalsHelper):
self.__container.show()
self.__toolbar = Toolbar(self)
self.__toolbar.show()
if App().settings.get_value("disable-csd") or is_unity():
self.__vgrid.add(self.__toolbar)
else:
self.set_titlebar(self.__toolbar)
self.__toolbar.set_show_close_button(
not App().settings.get_value("disable-csd"))
self.__vgrid.add(self.__toolbar)
self.__toolbar.set_show_close_button(True)
self.__vgrid.add(self.__container)
self.add(self.__vgrid)
self.__container.widget.connect("notify::folded",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment