Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed GameDetaisView/GameDetailsDialog background color for non-elementary gtk themes


Former-commit-id: 8dc569a
  • Loading branch information
tkashkin committed Aug 19, 2018
1 parent b2c9814 commit 1556c0e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 4 deletions.
11 changes: 11 additions & 0 deletions data/GameHub.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,14 @@ label.games-list-header
border-top: 1px alpha(#333, 0.3) solid;
border-bottom: 1px alpha(#333, 0.3) solid;
}

.gameinfo-background
{
background-color: rgb(245, 245, 245);
color: rgb(66, 66, 66);
}
.gameinfo-background.dark
{
background-color: rgb(59, 63, 69);
color: white;
}
4 changes: 2 additions & 2 deletions src/data/Game.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ namespace GameHub.Data

yield Utils.run_async(cmd, null, false, true);

Utils.run({"chmod", "-R", "+x", game.install_dir.get_path()});

try
{
string? dirname = null;
Expand All @@ -127,6 +125,8 @@ namespace GameHub.Data
}
catch(Error e){}

Utils.run({"chmod", "-R", "+x", game.install_dir.get_path()});

game.status = new Game.Status(game.executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED);
}
catch(IOError.CANCELLED e){}
Expand Down
3 changes: 2 additions & 1 deletion src/data/sources/gog/GOGGame.vala
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ namespace GameHub.Data.Sources.GOG
if(is_installed())
{
var path = executable.get_path();
yield Utils.run_thread({path}, null, true);
var dir = executable.get_parent().get_path();
yield Utils.run_thread({path}, dir, true);
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/data/sources/humble/HumbleGame.vala
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ namespace GameHub.Data.Sources.Humble
executable = chooser.get_file();
custom_info = @"{\"order\":\"$(order_id)\",\"executable\":\"$(executable.get_path())\"}";
status = new Game.Status(executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED);
if(executable.query_exists())
{
Utils.run({"chmod", "+x", executable.get_path()});
}
GamesDB.get_instance().add_game(this);
}

Expand All @@ -192,7 +196,8 @@ namespace GameHub.Data.Sources.Humble
if(is_installed())
{
var path = executable.get_path();
yield Utils.run_thread({path}, null, true);
var dir = executable.get_parent().get_path();
yield Utils.run_thread({path}, dir, true);
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/ui/dialogs/GameDetailsDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ namespace GameHub.UI.Dialogs
}
});

get_style_context().add_class("gameinfo-background");
var ui_settings = GameHub.Settings.UI.get_instance();
ui_settings.notify["dark-theme"].connect(() => {
get_style_context().remove_class("dark");
if(ui_settings.dark_theme) get_style_context().add_class("dark");
});
ui_settings.notify_property("dark-theme");

add_button(_("Close"), ResponseType.CLOSE).margin_end = 7;
show_all();
}
Expand Down
8 changes: 8 additions & 0 deletions src/ui/views/GameDetailsView/GameDetailsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ namespace GameHub.UI.Views.GameDetailsView
if(page != null) page.update();
});

get_style_context().add_class("gameinfo-background");
var ui_settings = GameHub.Settings.UI.get_instance();
ui_settings.notify["dark-theme"].connect(() => {
get_style_context().remove_class("dark");
if(ui_settings.dark_theme) get_style_context().add_class("dark");
});
ui_settings.notify_property("dark-theme");

Idle.add(update);
}

Expand Down

0 comments on commit 1556c0e

Please sign in to comment.