some fixes
This commit is contained in:
parent
c6c23a6850
commit
405bdb8e34
5 changed files with 17 additions and 18 deletions
|
@ -41,6 +41,7 @@ namespace Webpin {
|
|||
Type=Application
|
||||
Categories=Network;
|
||||
X-GNOME-FullName=webpin
|
||||
StartupWMClass=Webpin
|
||||
WebpinThemeColor=none""";
|
||||
|
||||
private GLib.KeyFile file;
|
||||
|
|
|
@ -62,8 +62,8 @@ namespace Webpin {
|
|||
add_button.tooltip_text = _("Add a new Web App");
|
||||
headerbar.pack_start (add_button);
|
||||
|
||||
var welcome = new Granite.Widgets.Welcome (_("No Web Apps Availible"), _("Create a new Webby Web App."));
|
||||
welcome.append ("document-new", _("Create App"), _("Create a new Webby web app."));
|
||||
var welcome = new Granite.Widgets.Welcome (_("No Web Apps Availible"), _("Create a new Webpin Web App."));
|
||||
welcome.append ("document-new", _("Create App"), _("Create a new Webpin web app."));
|
||||
welcome.activated.connect ((index) => {
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace Webpin {
|
|||
//load theme color saved in desktop file
|
||||
if (info != null && info.has_key("WebpinThemeColor")) {
|
||||
var color = info.get_string("WebpinThemeColor");
|
||||
print("COLOR: " + color+"\n");
|
||||
debug("COLOR: " + color+"\n");
|
||||
if(color != "none") {
|
||||
ui_color = color;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace Webpin {
|
|||
//update theme color if changed
|
||||
app_view.load_changed.connect ( (load_event) => {
|
||||
if (load_event == WebKit.LoadEvent.FINISHED) {
|
||||
print("determine color");
|
||||
debug ("determine color");
|
||||
determine_theme_color.begin();
|
||||
} else {
|
||||
container.set_visible(true);
|
||||
|
@ -149,24 +149,22 @@ namespace Webpin {
|
|||
|
||||
});*/
|
||||
|
||||
uint8[] data = {0, 0, 0};
|
||||
int snap_width = 0;
|
||||
try {
|
||||
var snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, WebKit.SnapshotOptions.NONE, null);
|
||||
Cairo.ImageSurface snap = null;
|
||||
|
||||
// data ist in BGRA apparently (according to testing). Docs said ARGB, but that
|
||||
// appears not to be the case
|
||||
data = snap.get_data ();
|
||||
snap_width = snap.get_width ();
|
||||
try {
|
||||
snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, WebKit.SnapshotOptions.NONE, null);
|
||||
} catch (Error e) {
|
||||
warning (e.message);
|
||||
}
|
||||
// data ist in BGRA apparently (according to testing). Docs said ARGB, but that
|
||||
// appears not to be the case
|
||||
unowned uint8[] data = snap.get_data ();
|
||||
|
||||
uint8 r = data[2];
|
||||
uint8 g = data[1];
|
||||
uint8 b = data[0];
|
||||
|
||||
for (var i = 4; i < snap_width * 3 * 4; i += 4) {
|
||||
for (var i = 4; i < snap.get_width () * 3 * 4; i += 4) {
|
||||
r = (r + data[i + 2]) / 2;
|
||||
g = (g + data[i + 1]) / 2;
|
||||
b = (b + data[i + 0]) / 2;
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace Webpin {
|
|||
//style
|
||||
if (web_app.ui_color != "none") {
|
||||
try {
|
||||
print("set color");
|
||||
debug ("set color");
|
||||
var style_cp = style_str.replace ("@titlebar_color", web_app.ui_color);
|
||||
var style_provider = new Gtk.CssProvider ();
|
||||
style_provider.load_from_data (style_cp, -1);
|
||||
|
@ -63,7 +63,7 @@ namespace Webpin {
|
|||
|
||||
web_app.theme_color_changed.connect( (color)=> {
|
||||
try {
|
||||
print("set color");
|
||||
debug ("set color");
|
||||
var style_cp = style_str.replace ("@titlebar_color", color);
|
||||
var style_provider = new Gtk.CssProvider ();
|
||||
style_provider.load_from_data (style_cp, -1);
|
||||
|
@ -92,14 +92,14 @@ namespace Webpin {
|
|||
this.destroy.connect(Gtk.main_quit);
|
||||
|
||||
web_app.external_request.connect ( () => {
|
||||
print("Web app external request\n");
|
||||
debug ("Web app external request\n");
|
||||
web_app.set_transition_type (Gtk.StackTransitionType.SLIDE_LEFT);
|
||||
headerbar.set_title_mode (WebBar.title_mode.BROWSER);
|
||||
web_app.set_visible_child_name ("external");
|
||||
});
|
||||
|
||||
headerbar.back_event.connect ( () => {
|
||||
print ("back");
|
||||
debug ("back");
|
||||
headerbar.set_title_mode (WebBar.title_mode.TITLE);
|
||||
web_app.set_transition_type (Gtk.StackTransitionType.SLIDE_RIGHT);
|
||||
web_app.set_visible_child_name ("app");
|
||||
|
|
Loading…
Reference in a new issue