pipe-viewer
pipe-viewer copied to clipboard
0.3.1 details window
can we have a drag bar between the description and the list? Maybe rearrange the list too? The single column wastes too much space.
Some of the fields can get pretty long... I'm not sure a drag bar would be that useful, isn't it faster to just scroll the description?
The list could be switched to a flowbox, POC:
bin/gtk-pipe-viewer | 23 ++++++++++++++++-------
share/gtk-pipe-viewer.glade | 18 +++++++-----------
2 files changed, 23 insertions(+), 18 deletions(-)
diff --git c/bin/gtk-pipe-viewer i/bin/gtk-pipe-viewer
index 11afbcb..845c7d7 100755
--- c/bin/gtk-pipe-viewer
+++ i/bin/gtk-pipe-viewer
@@ -406,6 +406,7 @@ my %objects = (
'channel_id_save' => \my $save_channel_id_entry,
'main-menu-history-menu' => \my $history_menu,
'features_flowbox' => \my $features_flowbox,
+ 'video_details_flowbox' => \my $video_details_flowbox,
);
while (my ($key, $value) = each %objects) {
@@ -3882,6 +3883,7 @@ sub set_entry_details {
$gui->get_object('video_title_label')->set_tooltip_markup("<b>$title</b>");
my $text_info;
+ my @details;
if ($type eq 'video') {
@@ -3897,24 +3899,21 @@ sub set_entry_details {
my $dislikes = $yv_utils->get_dislikes($info);
my $views = $yv_utils->get_views($info);
- $text_info = join(
- "\n",
+ @details = (
map { sprintf("%s %s", $_->[0], $_->[1]) }
grep { $_->[1] !~ /^(0|unknown)\z/i }
grep { defined($_->[1]) } (
[$symbols{author} => $yv_utils->get_channel_title($info)],
+ [$symbols{author_id} => $yv_utils->get_channel_id($info)],
[$symbols{category} => $yv_utils->get_category_name($info)],
+ [$symbols{published} => $yv_utils->get_publication_date($info)],
[$symbols{thumbs_up} => $yv_utils->set_thousands($likes)],
[$symbols{thumbs_down} => $yv_utils->set_thousands($dislikes)],
[$symbols{average} => $yv_utils->get_rating($info)],
[$symbols{play} => $yv_utils->get_time($info)],
[$symbols{views} => $yv_utils->set_thousands($views)],
- [$symbols{published} => $yv_utils->get_publication_date($info)],
- [$symbols{author_id} => $yv_utils->get_channel_id($info)],
)
);
-
- $text_info .= "\n";
}
elsif ($type eq 'playlist') {
@@ -3949,7 +3948,17 @@ EOT
);
}
- $gui->get_object('video_details_label')->set_label("<big>" . encode_entities("\n" . $text_info) . "</big>");
+ for my $child ($video_details_flowbox->get_children) {
+ $child->destroy;
+ }
+ for my $label (@details) {
+ my $label = Gtk3::Label->new($label);
+ $label->set_selectable(1);
+ $label->set_use_markup(1);
+ $label->set_xalign(0.0);
+ $label->show();
+ $video_details_flowbox->add($label);
+ }
# Setting the link button
my $url = make_youtube_url($type, $code);
diff --git c/share/gtk-pipe-viewer.glade i/share/gtk-pipe-viewer.glade
index 26c0805..0b13118 100644
--- c/share/gtk-pipe-viewer.glade
+++ i/share/gtk-pipe-viewer.glade
@@ -1919,19 +1919,18 @@ and others... https://github.com/trizen/pipe-viewer/graphs/contributors</propert
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
+ <property name="spacing">4</property>
<child>
- <object class="GtkLabel" id="video_details_label">
+ <object class="GtkFlowBox" id="video_details_flowbox">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="use-markup">True</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- <property name="ellipsize">end</property>
- <property name="width-chars">35</property>
+ <property name="selection-mode">none</property>
+ <property name="activate-on-single-click">False</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
+ <property name="padding">4</property>
<property name="position">0</property>
</packing>
</child>
@@ -1939,6 +1938,7 @@ and others... https://github.com/trizen/pipe-viewer/graphs/contributors</propert
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="margin-end">4</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1950,11 +1950,7 @@ and others... https://github.com/trizen/pipe-viewer/graphs/contributors</propert
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="margin-left">4</property>
- <property name="margin-right">4</property>
- <property name="margin-start">4</property>
<property name="margin-end">4</property>
- <property name="margin-top">4</property>
<property name="margin-bottom">4</property>
<property name="label-xalign">0</property>
<property name="shadow-type">out</property>
Note: only for videos, no channel or playlist support.
Note: I updated the patch above to be against the main branch (instead of #103).
well... now it gets into subjective preferences... like what fonts to use...
My subjective opinion.
The main window has already 4 of the values. I think it should also have the rating as an approximate measure of quality.
So in the details window, the list is less important, and you might want to hide it most of the time.
I don't really like completely breaking the column structure of the text. Stuff move around and it's harder for the brain to relocate them. I think it should be something rigid.
Also, i'm cramped in my little screen...
I don't really like completely breaking the column structure of the text. Stuff move around and it's harder for the brain to relocate them. I think it should be something rigid.
It's still columnar, but 3 things result in stuff moving around:
- the author/channel name can vary greatly in length
- instead of always showing all fields, some are hidden when zero / not available
- using formats like
👍 300,548
instead of shorter humanized versions like👍 300K
A way to make thing compact and avoid stuff moving around would be something like this:
So:
- author/channel name/id on 2 separate lines
- the rest of the details in another flowbox
- always show all fields (with
N/A
if the info is not available) - use short humanized numbers to keep the width of those fields pretty consistent
Also, i'm cramped in my little screen...
Out of curiosity, what resolution?
That's ok.
remove the rating, it's complete garbage. It only varies a little because of rounding errors. The code for the dislikes too can be removed.
The likes can also go on the main window. And now the details list is kind of redundant with what's on the main window, so a drag bar to have them hidden is still appropriate. There's even room for the ID on the main window, but i'm not sure how useful that is. That should go bellow the name. And the likes on the second column, second line in order not to brake the old positions.
I set the fonts very large because i don't see well, that's the real problem.
See #121.
The likes can also go on the main window. And now the details list is kind of redundant with what's on the main window, so a drag bar to have them hidden is still appropriate. There's even room for the ID on the main window, but i'm not sure how useful that is. That should go bellow the name. And the likes on the second column, second line in order not to brake the old positions.
Drag bars are problematic: they mess with resizing.
I agree that the results list needs some love:
- merge the 2 text columns
- get rid of the description (which, when not empty, is just a rehash of the other information)
- I don't think IDs are useful in that context: just keep the existing information, minus the description
and remove the rating....
@benoit-pierre
you should add back the progress indicator when loading the comments. It would be nice to add that in the main window, when you launch a video. It's handy when network quality is low.
you should add back the progress indicator when loading the comments.
There are spinners, when loading more comments/replies.
It would be nice to add that in the main window, when you launch a video. It's handy when network quality is low.
Between the click and launching the player?
you removed the spinner when loading the first page of comments. When they are no comments, you are not sure if it still loading or not.
Yea, between the click and the launch. If it takes too long, you aren't sure if you misscliked or not.
you removed the spinner when loading the first page of comments. When they are no comments, you are not sure if it still loading or not.
No, there's one when loading the first page too.
ahhh... yea, it's white on white.... But that's related to the theme.