This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New image provider class. Improved logo visibility. Fixed #41
- Loading branch information
1 parent
cf00c5a
commit 4788ea3
Showing
17 changed files
with
1,198 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
sub scale_pixbuf { | ||
my ($pixbuf, $parent) = @_; | ||
my $max_w = $parent->get_allocation()->{width}; | ||
my $max_h = $parent->get_allocation()->{height}; | ||
my $pixb_w = $pixbuf->get_width(); | ||
my $pixb_h = $pixbuf->get_height(); | ||
if (($pixb_w > $max_w) || ($pixb_h > $max_h)) { | ||
my $sc_factor_w = $max_w / $pixb_w; | ||
my $sc_factor_h = $max_h / $pixb_h; | ||
my $sc_factor = min $sc_factor_w, $sc_factor_h; | ||
my $sc_w = int($pixb_w * $sc_factor); | ||
my $sc_h = int($pixb_h * $sc_factor); | ||
my $scaled | ||
= $pixbuf->scale_simple($sc_w, $sc_h, 'GDK_INTERP_HYPER'); | ||
return $scaled; | ||
} | ||
return $pixbuf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Generated with glade 3.20.0 --> | ||
<interface> | ||
<requires lib="gtk+" version="3.14"/> | ||
<template class="GradioGridItem" parent="GtkFlowBoxChild"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="margin_left">2</property> | ||
<property name="margin_right">2</property> | ||
<property name="margin_top">2</property> | ||
<property name="margin_bottom">2</property> | ||
<child> | ||
<object class="GtkButton" id="button"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="receives_default">True</property> | ||
<signal name="clicked" handler="GradioGridItem_clicked" swapped="no"/> | ||
<child> | ||
<object class="GtkOverlay"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="orientation">vertical</property> | ||
<child> | ||
<object class="GtkImage" id="ChannelLogoImage"> | ||
<property name="width_request">64</property> | ||
<property name="height_request">64</property> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="margin_left">7</property> | ||
<property name="margin_right">7</property> | ||
<property name="margin_top">7</property> | ||
<property name="margin_bottom">7</property> | ||
<property name="icon_name">application-rss+xml-symbolic</property> | ||
<property name="icon_size">6</property> | ||
<style> | ||
<class name="border"/> | ||
</style> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="halign">start</property> | ||
<property name="valign">center</property> | ||
<property name="margin_top">7</property> | ||
<property name="margin_bottom">7</property> | ||
<property name="orientation">vertical</property> | ||
<child> | ||
<object class="GtkLabel" id="ChannelNameLabel"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="halign">start</property> | ||
<property name="label" translatable="yes">label</property> | ||
<attributes> | ||
<attribute name="weight" value="bold"/> | ||
</attributes> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkLabel" id="ChannelLocationLabel"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="halign">start</property> | ||
<property name="label" translatable="yes">label</property> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkLabel" id="ChannelTagsLabel"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="halign">start</property> | ||
<property name="label" translatable="yes">label</property> | ||
<attributes> | ||
<attribute name="style" value="oblique"/> | ||
</attributes> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">2</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">False</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="index">-1</property> | ||
</packing> | ||
</child> | ||
<child type="overlay"> | ||
<object class="GtkEventBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="above_child">True</property> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="width_request">30</property> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="halign">end</property> | ||
<property name="orientation">vertical</property> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="margin_left">2</property> | ||
<property name="margin_right">2</property> | ||
<property name="margin_top">2</property> | ||
<property name="margin_bottom">2</property> | ||
<property name="orientation">vertical</property> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="margin_top">2</property> | ||
<property name="orientation">vertical</property> | ||
<property name="homogeneous">True</property> | ||
<child> | ||
<object class="GtkImage" id="InLibraryImage"> | ||
<property name="can_focus">False</property> | ||
<property name="no_show_all">True</property> | ||
<property name="icon_name">starred-symbolic</property> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkImage" id="NotInLibraryImage"> | ||
<property name="can_focus">False</property> | ||
<property name="no_show_all">True</property> | ||
<property name="icon_name">non-starred-symbolic</property> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="orientation">vertical</property> | ||
<property name="spacing">6</property> | ||
<child> | ||
<object class="GtkImage"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="icon_name">emote-love-symbolic</property> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkLabel" id="LikesLabel"> | ||
<property name="visible">True</property> | ||
<property name="can_focus">False</property> | ||
<property name="label" translatable="yes">999</property> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="pack_type">end</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">True</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<style> | ||
<class name="grid-overlay-box"/> | ||
</style> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
<style> | ||
<class name="grid-item"/> | ||
</style> | ||
</object> | ||
</child> | ||
</template> | ||
</interface> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.