Skip to content

Commit 0dfb6f1

Browse files
add rounded borders to some LayoutElement implementations
1 parent d0c193c commit 0dfb6f1

18 files changed

Lines changed: 488 additions & 77 deletions

.github/workflows/check_layout_element_inheritance.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def main(root: str):
124124
"background_color",
125125
"border_color",
126126
"border_dash_pattern",
127+
"border_radius_bottom_left",
128+
"border_radius_bottom_right",
129+
"border_radius_top_left",
130+
"border_radius_top_right",
127131
"border_width_bottom",
128132
"border_width_left",
129133
"border_width_right",
-5.15 KB
Binary file not shown.

borb/pdf/layout_element/form/button.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def __init__(
4545
border_color: typing.Optional[Color] = X11Color.GRAY,
4646
border_dash_pattern: typing.Optional[typing.List[int]] = None,
4747
border_dash_phase: int = 0,
48+
border_radius_bottom_left: int = 0,
49+
border_radius_bottom_right: int = 0,
50+
border_radius_top_left: int = 0,
51+
border_radius_top_right: int = 0,
4852
border_width_bottom: int = 1,
4953
border_width_left: int = 1,
5054
border_width_right: int = 1,
@@ -73,6 +77,10 @@ def __init__(
7377
:param border_color: Optional; The color of the border around the text box. If None, no border will be drawn.
7478
:param border_dash_pattern: A list of integers defining the dash pattern for the border. For example, [5, 3] creates a dashed border.
7579
:param border_dash_phase: The phase at which the dash pattern should start. Defaults to 0.
80+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
81+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
82+
:param border_radius_top_left: Radius of the top left border of the element.
83+
:param border_radius_top_right: Radius of the top right border of the element.
7684
:param border_width_bottom: The width of the bottom border in pixels. Defaults to 0 (no bottom border).
7785
:param border_width_left: The width of the left border in pixels. Defaults to 0 (no left border).
7886
:param border_width_right: The width of the right border in pixels. Defaults to 0 (no right border).
@@ -102,6 +110,10 @@ def __init__(
102110
border_color=border_color,
103111
border_dash_pattern=border_dash_pattern,
104112
border_dash_phase=border_dash_phase,
113+
border_radius_bottom_left=border_radius_bottom_left,
114+
border_radius_bottom_right=border_radius_bottom_right,
115+
border_radius_top_left=border_radius_top_left,
116+
border_radius_top_right=border_radius_top_right,
105117
border_width_bottom=border_width_bottom,
106118
border_width_left=border_width_left,
107119
border_width_right=border_width_right,

borb/pdf/layout_element/form/country_drop_down_list.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def __init__(
3636
border_color: typing.Optional[Color] = X11Color.LIGHT_GRAY,
3737
border_dash_pattern: typing.Optional[typing.List[int]] = None,
3838
border_dash_phase: int = 0,
39+
border_radius_bottom_left: int = 0,
40+
border_radius_bottom_right: int = 0,
41+
border_radius_top_left: int = 0,
42+
border_radius_top_right: int = 0,
3943
border_width_bottom: int = 1,
4044
border_width_left: int = 1,
4145
border_width_right: int = 1,
@@ -63,6 +67,10 @@ def __init__(
6367
:param border_color: The color of the dropdown's border. Defaults to None.
6468
:param border_dash_pattern: A list specifying the dash pattern for the border. Defaults to an empty list (solid border).
6569
:param border_dash_phase: The phase offset for the border dash pattern. Defaults to 0.
70+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
71+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
72+
:param border_radius_top_left: Radius of the top left border of the element.
73+
:param border_radius_top_right: Radius of the top right border of the element.
6674
:param border_width_bottom: The width of the bottom border of the dropdown. Defaults to 0.
6775
:param border_width_left: The width of the left border of the dropdown. Defaults to 0.
6876
:param border_width_right: The width of the right border of the dropdown. Defaults to 0.
@@ -288,6 +296,10 @@ def __init__(
288296
border_color=border_color,
289297
border_dash_pattern=border_dash_pattern,
290298
border_dash_phase=border_dash_phase,
299+
border_radius_bottom_left=border_radius_bottom_left,
300+
border_radius_bottom_right=border_radius_bottom_right,
301+
border_radius_top_left=border_radius_top_left,
302+
border_radius_top_right=border_radius_top_right,
291303
border_width_bottom=border_width_bottom,
292304
border_width_left=border_width_left,
293305
border_width_right=border_width_right,

borb/pdf/layout_element/form/drop_down_list.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ def __init__(
4242
border_color: typing.Optional[Color] = X11Color.LIGHT_GRAY,
4343
border_dash_pattern: typing.Optional[typing.List[int]] = None,
4444
border_dash_phase: int = 0,
45+
border_radius_bottom_left: int = 0,
46+
border_radius_bottom_right: int = 0,
47+
border_radius_top_left: int = 0,
48+
border_radius_top_right: int = 0,
4549
border_width_bottom: int = 1,
4650
border_width_left: int = 1,
4751
border_width_right: int = 1,
@@ -70,6 +74,10 @@ def __init__(
7074
:param border_color: The color of the dropdown's border. Defaults to None.
7175
:param border_dash_pattern: A list specifying the dash pattern for the border. Defaults to an empty list (solid border).
7276
:param border_dash_phase: The phase offset for the border dash pattern. Defaults to 0.
77+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
78+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
79+
:param border_radius_top_left: Radius of the top left border of the element.
80+
:param border_radius_top_right: Radius of the top right border of the element.
7381
:param border_width_bottom: The width of the bottom border of the dropdown. Defaults to 0.
7482
:param border_width_left: The width of the left border of the dropdown. Defaults to 0.
7583
:param border_width_right: The width of the right border of the dropdown. Defaults to 0.
@@ -100,6 +108,10 @@ def __init__(
100108
border_color=border_color,
101109
border_dash_pattern=border_dash_pattern,
102110
border_dash_phase=border_dash_phase,
111+
border_radius_bottom_left=border_radius_bottom_left,
112+
border_radius_bottom_right=border_radius_bottom_right,
113+
border_radius_top_left=border_radius_top_left,
114+
border_radius_top_right=border_radius_top_right,
103115
border_width_bottom=border_width_bottom,
104116
border_width_left=border_width_left,
105117
border_width_right=border_width_right,

borb/pdf/layout_element/form/gender_drop_down_list.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def __init__(
3636
border_color: typing.Optional[Color] = X11Color.LIGHT_GRAY,
3737
border_dash_pattern: typing.Optional[typing.List[int]] = None,
3838
border_dash_phase: int = 0,
39+
border_radius_bottom_left: int = 0,
40+
border_radius_bottom_right: int = 0,
41+
border_radius_top_left: int = 0,
42+
border_radius_top_right: int = 0,
3943
border_width_bottom: int = 1,
4044
border_width_left: int = 1,
4145
border_width_right: int = 1,
@@ -63,6 +67,10 @@ def __init__(
6367
:param border_color: The color of the dropdown's border. Defaults to None.
6468
:param border_dash_pattern: A list specifying the dash pattern for the border. Defaults to an empty list (solid border).
6569
:param border_dash_phase: The phase offset for the border dash pattern. Defaults to 0.
70+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
71+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
72+
:param border_radius_top_left: Radius of the top left border of the element.
73+
:param border_radius_top_right: Radius of the top right border of the element.
6674
:param border_width_bottom: The width of the bottom border of the dropdown. Defaults to 0.
6775
:param border_width_left: The width of the left border of the dropdown. Defaults to 0.
6876
:param border_width_right: The width of the right border of the dropdown. Defaults to 0.
@@ -92,6 +100,10 @@ def __init__(
92100
border_color=border_color,
93101
border_dash_pattern=border_dash_pattern,
94102
border_dash_phase=border_dash_phase,
103+
border_radius_bottom_left=border_radius_bottom_left,
104+
border_radius_bottom_right=border_radius_bottom_right,
105+
border_radius_top_left=border_radius_top_left,
106+
border_radius_top_right=border_radius_top_right,
95107
border_width_bottom=border_width_bottom,
96108
border_width_left=border_width_left,
97109
border_width_right=border_width_right,

borb/pdf/layout_element/form/javascript_button.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def __init__(
4343
border_color: typing.Optional[Color] = X11Color.GRAY,
4444
border_dash_pattern: typing.Optional[typing.List[int]] = None,
4545
border_dash_phase: int = 0,
46+
border_radius_bottom_left: int = 0,
47+
border_radius_bottom_right: int = 0,
48+
border_radius_top_left: int = 0,
49+
border_radius_top_right: int = 0,
4650
border_width_bottom: int = 1,
4751
border_width_left: int = 1,
4852
border_width_right: int = 1,
@@ -72,6 +76,10 @@ def __init__(
7276
:param border_color: Optional; The color of the border around the text box. If None, no border will be drawn.
7377
:param border_dash_pattern: A list of integers defining the dash pattern for the border. For example, [5, 3] creates a dashed border.
7478
:param border_dash_phase: The phase at which the dash pattern should start. Defaults to 0.
79+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
80+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
81+
:param border_radius_top_left: Radius of the top left border of the element.
82+
:param border_radius_top_right: Radius of the top right border of the element.
7583
:param border_width_bottom: The width of the bottom border in pixels. Defaults to 0 (no bottom border).
7684
:param border_width_left: The width of the left border in pixels. Defaults to 0 (no left border).
7785
:param border_width_right: The width of the right border in pixels. Defaults to 0 (no right border).
@@ -98,6 +106,10 @@ def __init__(
98106
border_color=border_color,
99107
border_dash_pattern=border_dash_pattern,
100108
border_dash_phase=border_dash_phase,
109+
border_radius_bottom_left=border_radius_bottom_left,
110+
border_radius_bottom_right=border_radius_bottom_right,
111+
border_radius_top_left=border_radius_top_left,
112+
border_radius_top_right=border_radius_top_right,
101113
border_width_bottom=border_width_bottom,
102114
border_width_left=border_width_left,
103115
border_width_right=border_width_right,

borb/pdf/layout_element/form/text_area.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def __init__(
4141
border_color: typing.Optional[Color] = X11Color.LIGHT_GRAY,
4242
border_dash_pattern: typing.Optional[typing.List[int]] = None,
4343
border_dash_phase: int = 0,
44+
border_radius_bottom_left: int = 0,
45+
border_radius_bottom_right: int = 0,
46+
border_radius_top_left: int = 0,
47+
border_radius_top_right: int = 0,
4448
border_width_bottom: int = 1,
4549
border_width_left: int = 1,
4650
border_width_right: int = 1,
@@ -69,6 +73,10 @@ def __init__(
6973
:param border_color: Optional; The color of the border around the text area. If None, no border will be drawn.
7074
:param border_dash_pattern: A list of integers defining the dash pattern for the border. For example, [5, 3] creates a dashed border.
7175
:param border_dash_phase: The phase at which the dash pattern should start. Defaults to 0.
76+
:param border_radius_bottom_left: Radius of the bottom left border of the element.
77+
:param border_radius_bottom_right: Radius of the bottom right border of the element.
78+
:param border_radius_top_left: Radius of the top left border of the element.
79+
:param border_radius_top_right: Radius of the top right border of the element.
7280
:param border_width_bottom: The width of the bottom border in pixels. Defaults to 0 (no bottom border).
7381
:param border_width_left: The width of the left border in pixels. Defaults to 0 (no left border).
7482
:param border_width_right: The width of the right border in pixels. Defaults to 0 (no right border).
@@ -100,6 +108,10 @@ def __init__(
100108
border_color=border_color,
101109
border_dash_pattern=border_dash_pattern,
102110
border_dash_phase=border_dash_phase,
111+
border_radius_bottom_left=border_radius_bottom_left,
112+
border_radius_bottom_right=border_radius_bottom_right,
113+
border_radius_top_left=border_radius_top_left,
114+
border_radius_top_right=border_radius_top_right,
103115
border_width_bottom=border_width_bottom,
104116
border_width_left=border_width_left,
105117
border_width_right=border_width_right,

0 commit comments

Comments
 (0)