sidebar: Create a row Label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
fdc4bb7275
commit
b75fc78de7
|
@ -0,0 +1,10 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Pango
|
||||
|
||||
class Label(Gtk.Label):
|
||||
def __init__(self):
|
||||
Gtk.Label.__init__(self)
|
||||
self.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
|
||||
self.set_halign(Gtk.Align.START)
|
||||
self.set_hexpand(True)
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
import unittest
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Pango
|
||||
from . import row
|
||||
|
||||
class TestLabel(unittest.TestCase):
|
||||
def test_init(self):
|
||||
label = row.Label()
|
||||
self.assertIsInstance(label, Gtk.Label)
|
||||
self.assertEqual(label.get_ellipsize(), Pango.EllipsizeMode.MIDDLE)
|
||||
self.assertEqual(label.get_halign(), Gtk.Align.START)
|
||||
self.assertTrue(label.get_hexpand())
|
Loading…
Reference in New Issue