From c1eaa8e52d00c70a4fa1f88683a1fa483437b93a Mon Sep 17 00:00:00 2001 From: Rares Visalom Date: Thu, 13 Jul 2017 21:37:04 +0300 Subject: [PATCH] separator: Remove HorizontalSeparator It's now unused. --- js/js-resources.gresource.xml | 1 - js/ui/separator.js | 35 ----------------------------------- 2 files changed, 36 deletions(-) delete mode 100644 js/ui/separator.js diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml index a1a419686..591875f8c 100644 --- a/js/js-resources.gresource.xml +++ b/js/js-resources.gresource.xml @@ -87,7 +87,6 @@ ui/screenshot.js ui/scripting.js ui/search.js - ui/separator.js ui/sessionMode.js ui/shellDBus.js ui/shellEntry.js diff --git a/js/ui/separator.js b/js/ui/separator.js deleted file mode 100644 index 1de1d89c3..000000000 --- a/js/ui/separator.js +++ /dev/null @@ -1,35 +0,0 @@ -// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- - -const Cairo = imports.cairo; -const Lang = imports.lang; -const St = imports.gi.St; - -const HorizontalSeparator = new Lang.Class({ - Name: 'HorizontalSeparator', - - _init: function (params) { - this.actor = new St.DrawingArea(params); - this.actor.connect('repaint', Lang.bind(this, this._onRepaint)); - }, - - _onRepaint: function(area) { - let cr = area.get_context(); - let themeNode = area.get_theme_node(); - let [width, height] = area.get_surface_size(); - let margin = themeNode.get_length('-margin-horizontal'); - let gradientHeight = themeNode.get_length('-gradient-height'); - let startColor = themeNode.get_color('-gradient-start'); - let endColor = themeNode.get_color('-gradient-end'); - - let gradientWidth = (width - margin * 2); - let gradientOffset = (height - gradientHeight) / 2; - let pattern = new Cairo.LinearGradient(margin, gradientOffset, width - margin, gradientOffset + gradientHeight); - pattern.addColorStopRGBA(0, startColor.red / 255, startColor.green / 255, startColor.blue / 255, startColor.alpha / 255); - pattern.addColorStopRGBA(0.5, endColor.red / 255, endColor.green / 255, endColor.blue / 255, endColor.alpha / 255); - pattern.addColorStopRGBA(1, startColor.red / 255, startColor.green / 255, startColor.blue / 255, startColor.alpha / 255); - cr.setSource(pattern); - cr.rectangle(margin, gradientOffset, gradientWidth, gradientHeight); - cr.fill(); - cr.$dispose(); - } -});