Skip to content

Commit

Permalink
yarr@jtoberling: Changes due to reloading issue (#929)
Browse files Browse the repository at this point in the history
* fix reloading issue
  • Loading branch information
jtoberling authored Oct 13, 2023
1 parent 5b459db commit dc74606
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
27 changes: 15 additions & 12 deletions yarr@jtoberling/files/yarr@jtoberling/desklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,13 @@ class YarrDesklet extends Desklet.Desklet {
context,
{
'channel': feed.name,
'timestamp': parsedDate,
'timestamp': parsedDate,
'pubDate': item.pubDate,
'title': item.title,
'link': item.link,
'category': catStr,
'description': item.description,
"labelColor": feed.labelcolor
'link': item.link,
'category': catStr,
'description': item.description,
"labelColor": feed.labelcolor
}
);
}
Expand Down Expand Up @@ -423,6 +423,11 @@ class YarrDesklet extends Desklet.Desklet {
return retStr;
}

onClickedButton(selfObj, p2, uri) {
Gio.app_info_launch_default_for_uri(uri, global.create_app_launch_context());
}


displayItems(context) {

let updated= new Date();
Expand All @@ -433,9 +438,8 @@ class YarrDesklet extends Desklet.Desklet {
for(let [key, item] of context.items ) {

const lineBox = new St.BoxLayout({ vertical: false });

const feedButton = new YarrLinkButton.YarrLinkButton({ label: "["+item.channel +"]" , style_class: 'channelbutton', style: 'background-color: ' + item.labelColor });
feedButton.setUri(item.link);

const feedButton = new St.Button({ label: "["+item.channel +"]" , style_class: 'channelbutton', style: 'width: 80px; background-color: ' + item.labelColor });

let toolTipText =
'<big><b><u>' + this.formatTextWrap(item.channel + ': ' + item.title, 100) + '</u></b></big>'
Expand All @@ -450,10 +454,9 @@ class YarrDesklet extends Desklet.Desklet {
toolTip._tooltip.clutter_text.allocate_preferred_size(Clutter.AllocationFlags.NONE);
toolTip._tooltip.queue_relayout();

lineBox.add( feedButton );
feedButton.connect("clicked", Lang.bind(this, function(p1, p2) {
Gio.app_info_launch_default_for_uri(p1.getUri(), global.create_app_launch_context());
}));
lineBox.add(feedButton);

this._signals.connect( feedButton, 'clicked', (...args) => this.onClickedButton(...args, item.link) );

const dateLabel = new St.Label({ text: ' ' + context._formatedDate(item.timestamp, false) + ' ', style: 'text-align: center;' });
lineBox.add(dateLabel);
Expand Down
25 changes: 0 additions & 25 deletions yarr@jtoberling/files/yarr@jtoberling/linkbutton.js

This file was deleted.

2 changes: 1 addition & 1 deletion yarr@jtoberling/files/yarr@jtoberling/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"max-instances": "1",
"description": "Yet Another RSS Reader - now as Cinnamon Desklet",
"name": "Yet Another RSS Reader",
"version": "0.0.3",
"version": "0.0.4",
"uuid": "yarr@jtoberling",
"multiversion": true,
"author": "jtoberling",
Expand Down

0 comments on commit dc74606

Please sign in to comment.