new version; switched to handy avatar

parent 73fba14c
Pipeline #215855 failed with stage
in 14 minutes and 17 seconds
......@@ -10,7 +10,7 @@ test:
- pyflakes gfeeds
flatpak:
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36'
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38'
variables:
MANIFEST_PATH: "dist/flatpak/org.gabmus.gfeeds.json"
MESON_ARGS: "-Dprofile=Devel"
......
......@@ -54,6 +54,14 @@
<url type="bugtracker">https://gitlab.com/gabmus/gnome-feeds/issues</url>
<update_contact>gabmus@disroot.org</update_contact>
<releases>
<release version="0.15" timestamp="1600839902">
<description>
<ul>
<li>Switched to the new libhandy Avatar widget</li>
<li>Added Dutch translation courtesy of Heimen Stoffels</li>
</ul>
</description>
</release>
<release version="0.14.1" timestamp="1595058263">
<description>
<ul>
......
......@@ -37,120 +37,6 @@
* https://www.w3.org/TR/css-fonts-3/#font-face-rule
*/
@font-face {
font-family: ephy-reader-serif;
src: local('DejaVu Serif'),
local('DejaVu Serif Book');
font-weight: normal;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-serif;
src: local('DejaVu Serif Italic');
font-weight: normal;
font-style: italic;
font-display: block;
}
@font-face {
font-family: ephy-reader-serif;
src:local('DejaVu Serif Bold');
font-weight: bold;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-serif;
src:local('DejaVu Serif Bold Italic');
font-weight: bold;
font-style: italic;
font-display: block;
}
@font-face {
font-family: ephy-reader-sans;
src: local('Cantarell'),
local('DejaVu Sans');
font-weight: normal;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-sans;
src: local('Cantarell Italic'),
local('DejaVu Sans Italic');
font-weight: normal;
font-style: italic;
font-display: block;
}
@font-face {
font-family: ephy-reader-sans;
src: local('Cantarell Bold'),
local('DejaVu Sans Bold')
format('truetype');
font-weight: bold;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-sans;
src: local('Cantarell Bold Italic'),
local('DejaVu Sans Bold Italic');
font-weight: bold;
font-style: italic;
font-display: block;
}
@font-face {
font-family: ephy-reader-mono;
src: local('Fira Mono'),
local('Source Code Pro'),
local('DejaVu Sans Mono'),
local('DejaVu Sans Mono Book');
font-weight: normal;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-mono;
src: local('Fira Mono Italic'),
local('Source Code Pro Italic'),
local('DejaVu Sans Mono Italic'),
local('DejaVu Sans Mono Oblique');
font-weight: normal;
font-style: italic;
font-display: block;
}
@font-face {
font-family: ephy-reader-mono;
src: local('Fira Mono Bold'),
local('Source Code Pro Bold'),
local('DejaVu Sans Mono Bold');
font-weight: bold;
font-style: normal;
font-display: block;
}
@font-face {
font-family: ephy-reader-mono;
src: local('Fira Mono Bold Italic'),
local('Source Code Pro Bold Italic'),
local('DejaVu Sans Mono Bold Italic'),
local('DejaVu Sans Mono Bold Oblique');
font-weight: bold;
font-style: italic;
font-display: block;
}
body.sans {
font-family: ephy-reader-sans, sans-serif;
}
......
......@@ -2,7 +2,7 @@
"app-id": "org.gabmus.gfeeds",
"command": "gfeeds",
"runtime": "org.gnome.Platform",
"runtime-version": "3.36",
"runtime-version": "3.38",
"sdk": "org.gnome.Sdk",
"finish-args": [
"--device=dri",
......@@ -27,7 +27,7 @@
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/libhandy",
"tag": "0.84.0"
"tag": "1.0.0"
}
]
},
......@@ -692,9 +692,9 @@
{
"type": "git",
"url": "https://gitlab.gnome.org/World/gfeeds",
"tag": "0.14.1"
"tag": "0.15"
}
]
}
]
}
}
\ No newline at end of file
......@@ -118,7 +118,7 @@ class ConfManager(metaclass=Singleton):
self.saved_cache_path = f'{self.cache_path}/saved_articles'
self.conf = None
if isfile(self.path):
if self.path.is_file():
try:
with open(self.path) as fd:
self.conf = json.loads(fd.read())
......@@ -149,8 +149,8 @@ class ConfManager(metaclass=Singleton):
self.thumbs_cache_path,
self.saved_cache_path
]:
if not isdir(p):
makedirs(p)
if not isdir(str(p)):
makedirs(str(p))
self.read_feeds_items = SignalerList(self.conf['read_items'])
self.read_feeds_items.connect(
......@@ -168,6 +168,17 @@ class ConfManager(metaclass=Singleton):
'minimize:' in bl
)
# font_gsettings = Gio.Settings.new('org.gnome.destkop.interface')
# self.sans_font = font_gsettings.get_value(
# 'font-name'
# ).get_string()
# self.serif_font = font_gsettings.get_value(
# 'document-font-name'
# ).get_string()
# self.mono_font = font_gsettings.get_value(
# 'monospace-font-name'
# ).get_string()
@property
def max_article_age(self) -> timedelta:
return timedelta(days=self.conf['max_article_age_days'])
......@@ -204,7 +215,7 @@ class ConfManager(metaclass=Singleton):
self.conf['read_items'] = self.read_feeds_items.get_list()
def save_conf(self, *args):
if isfile(self.path):
if self.path.is_file():
with open(self.path, 'r') as fd:
if json.loads(fd.read()) == self.conf:
return
......
......@@ -42,12 +42,10 @@ class FeedsViewListboxRow(Gtk.ListBoxRow):
self.checkbox.hide()
self.icon_container = self.builder.get_object('icon_container')
if isfile(self.feed.favicon_path):
self.icon = Gtk.Image.new_from_file(
self.feed.favicon_path
)
else:
self.icon = InitialsIcon(self.feed.title)
self.icon = InitialsIcon(
self.feed.title,
self.feed.favicon_path
)
self.icon_container.add(self.icon)
self.name_label = self.builder.get_object('title_label')
......
from gi.repository import Gtk
from gfeeds.confManager import ConfManager
from gi.repository import Gtk, Handy, GdkPixbuf
from os.path import isfile
class InitialsIcon(Gtk.Bin):
confman = ConfManager()
def __init__(self, name, **kwargs):
def __init__(self, name, image_path, **kwargs):
super().__init__(**kwargs)
self.name = name
self.label = Gtk.Label()
namesplit = self.name.split()
if len(namesplit) >= 2:
self.initials = f'{namesplit[0][0]}{namesplit[1][0]}'.upper()
else:
self.initials = f'{self.name[0]}{self.name[1]}'.upper()
self.icon_overlay = Gtk.Overlay()
image = Gtk.Image.new_from_icon_name(
'circle-filled-symbolic', Gtk.IconSize.INVALID
)
image.set_pixel_size(32)
self.label.set_markup(
'<span fgcolor="#{0}" weight="semibold">{1}</span>'.format(
InitialsIcon.confman.get_background_color(),
self.initials
)
self.image_path = image_path
self.avatar = Handy.Avatar.new(
32,
self.name,
True
)
self.icon_overlay.add(image)
self.icon_overlay.add_overlay(self.label)
self.avatar.set_image_load_func(self.__set_avatar_func)
self.add(self.avatar)
self.add(self.icon_overlay)
def __set_avatar_func(self, *args):
return (
GdkPixbuf.Pixbuf.new_from_file(self.image_path)
if isfile(self.image_path) else None
)
from gfeeds.confManager import ConfManager
from gi.repository import Gio
CSS = Gio.resources_lookup_data(
confman = ConfManager()
sans_font = 'Cantarell' # confman.sans_font
serif_font = 'DejaVu Serif' # confman.serif_font
mono_font = 'DejaVu Sans Mono' # confman.mono_font
CSS = f'''@font-face {{
font-family: ephy-reader-serif;
src: local('{serif_font}');
font-weight: normal;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-serif;
src: local('{serif_font} Italic');
font-weight: normal;
font-style: italic;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-serif;
src:local('{serif_font} Bold');
font-weight: bold;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-serif;
src:local('{serif_font} Bold Italic');
font-weight: bold;
font-style: italic;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-sans;
src: local('{sans_font}');
font-weight: normal;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-sans;
src: local('{sans_font} Italic');
font-weight: normal;
font-style: italic;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-sans;
src: local('{sans_font} Bold');
font-weight: bold;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-sans;
src: local('{sans_font} Bold Italic');
font-weight: bold;
font-style: italic;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-mono;
src: local('{mono_font}');
font-weight: normal;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-mono;
src: local('{mono_font} Italic');
font-weight: normal;
font-style: italic;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-mono;
src: local('{mono_font} Bold');
font-weight: bold;
font-style: normal;
font-display: block;
}}
@font-face {{
font-family: ephy-reader-mono;
src: local('{mono_font} Bold Italic');
font-weight: bold;
font-style: italic;
font-display: block;
}}
''' + Gio.resources_lookup_data(
'/org/gabmus/gfeeds/reader_mode_style.css',
Gio.ResourceLookupFlags.NONE
).get_data().decode()
......
......@@ -34,12 +34,10 @@ class GFeedsSidebarRow(Gtk.ListBoxRow):
self.on_full_feed_name_changed()
self.icon_container = self.builder.get_object('icon_container')
if isfile(self.feeditem.parent_feed.favicon_path):
self.icon = Gtk.Image.new_from_file(
self.feeditem.parent_feed.favicon_path
)
else:
self.icon = InitialsIcon(self.feeditem.parent_feed.title)
self.icon = InitialsIcon(
self.feeditem.parent_feed.title,
self.feeditem.parent_feed.favicon_path
)
self.icon_container.add(self.icon)
# Date & time stuff is long
......
project('gfeeds',
version: '0.14.1',
version: '0.15',
meson_version: '>= 0.50.0',
license: 'GPL3'
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment