Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 114 additions & 74 deletions crates/rnote-ui/data/ui/penssidebar/shaperpage.ui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<interface>
<template class="RnShaperPage" parent="GtkWidget">
<property name="layout-manager">
Expand Down Expand Up @@ -26,11 +26,23 @@
</object>
</child>
<child>
<object class="GtkMenuButton" id="shapeconfig_menubutton">
<object class="GtkMenuButton" id="shapestyling_menubutton">
<property name="icon-name">pen-shaper-style-smooth-symbolic</property>
<property name="direction">left</property>
<property name="tooltip_text" translatable="yes">Shape Styling</property>
<property name="popover">shapestyling_popover</property>
<style>
<class name="flat" />
<class name="sidebar_action_button" />
</style>s
</object>
</child>
<child>
<object class="GtkMenuButton" id="shaperconfig_menubutton">
<property name="icon-name">settings-symbolic</property>
<property name="direction">left</property>
<property name="tooltip_text" translatable="yes">Shape Configuration</property>
<property name="popover">shapeconfig_popover</property>
<property name="tooltip_text" translatable="yes">Shaper Configuration</property>
<property name="popover">shaperconfig_popover</property>
<style>
<class name="flat" />
</style>
Expand All @@ -53,8 +65,8 @@
</object>
</child>

<!-- Shape config -->
<object class="GtkPopover" id="shapeconfig_popover">
<!-- Shape styling -->
<object class="GtkPopover" id="shapestyling_popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
Expand All @@ -68,7 +80,7 @@
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Shape Configuration</property>
<property name="label" translatable="yes">Shape Styling</property>
<property name="hexpand">true</property>
<property name="halign">center</property>
<style>
Expand All @@ -77,7 +89,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="shapeconfig_popover_close_button">
<object class="GtkButton" id="shapestyling_popover_close_button">
<property name="icon-name">window-close-symbolic</property>
<style>
<class name="flat" />
Expand Down Expand Up @@ -126,41 +138,12 @@
</object>
</child>

<!-- Highlighting -->
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Highlighting</property>
<child>
<object class="AdwSwitchRow" id="highlight_mode_row">
<property name="title" translatable="yes">Highlight-Mode</property>
<property name="subtitle" translatable="yes">Fade active color</property>
</object>
</child>
<child>
<object class="AdwSpinRow" id="highlight_opacity_row">
<property name="title" translatable="yes">Highlight-Opacity</property>
<property name="subtitle" translatable="yes">Modify the highlight opacity (%)</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">0</property>
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
</object>
</property>
<property name="numeric">true</property>
<property name="digits">0</property>
</object>
</child>
</object>
</child>

<!-- Smooth options -->
<child>
<object class="AdwPreferencesGroup" id="smoothstyle_group">
<property name="title" translatable="yes">Smooth Style</property>
<object class="AdwPreferencesGroup" id="smoothoptions_group">
<property name="title" translatable="yes">Smooth Options</property>
<child>
<object class="AdwComboRow" id="smoothstyle_line_cap_row">
<object class="AdwComboRow" id="smoothoptions_line_cap_row">
<property name="title" translatable="yes">Line Cap</property>
<property name="subtitle" translatable="yes">Choose a line cap</property>
<property name="model">
Expand All @@ -174,7 +157,7 @@
</object>
</child>
<child>
<object class="AdwComboRow" id="smoothstyle_line_style_row">
<object class="AdwComboRow" id="smoothoptions_line_style_row">
<property name="title" translatable="yes">Line Style</property>
<property name="subtitle" translatable="yes">Choose a line style</property>
<property name="model">
Expand All @@ -195,10 +178,10 @@

<!-- Rough options -->
<child>
<object class="AdwPreferencesGroup" id="roughstyle_group">
<property name="title" translatable="yes">Rough Style</property>
<object class="AdwPreferencesGroup" id="roughoptions_group">
<property name="title" translatable="yes">Rough Options</property>
<child>
<object class="AdwComboRow" id="roughstyle_fillstyle_row">
<object class="AdwComboRow" id="roughoptions_fillstyle_row">
<property name="title" translatable="yes">Fill Style</property>
<property name="subtitle" translatable="yes">Choose a fill style</property>
<property name="model">
Expand All @@ -217,7 +200,7 @@
</object>
</child>
<child>
<object class="AdwSpinRow" id="roughstyle_hachure_angle_row">
<object class="AdwSpinRow" id="roughoptions_hachure_angle_row">
<property name="title" translatable="yes">Hachure Angle</property>
<property name="subtitle" translatable="yes">Set the angle of hachure fills</property>
<property name="adjustment">
Expand All @@ -234,41 +217,98 @@
</child>
</object>
</child>
</object>
</child>
</object>

<!-- Shaper Config -->
<object class="GtkPopover" id="shaperconfig_popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="spacing">12</property>
<property name="width-request">300</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Shaper Configuration</property>
<property name="hexpand">true</property>
<property name="halign">center</property>
<style>
<class name="title-3" />
</style>
</object>
</child>
<child>
<object class="GtkButton" id="shaperconfig_popover_close_button">
<property name="icon-name">window-close-symbolic</property>
<style>
<class name="flat" />
<class name="circular" />
</style>
</object>
</child>
</object>
</child>

<!-- Highlighting -->
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Highlighting</property>
<child>
<object class="AdwSwitchRow" id="highlight_mode_row">
<property name="title" translatable="yes">Highlight-Mode</property>
<property name="subtitle" translatable="yes">Fade active color</property>
</object>
</child>
<child>
<object class="AdwSpinRow" id="highlight_opacity_row">
<property name="title" translatable="yes">Highlight-Opacity</property>
<property name="subtitle" translatable="yes">Modify the highlight opacity (%)</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">0</property>
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
</object>
</property>
<property name="numeric">true</property>
<property name="digits">0</property>
</object>
</child>
</object>
</child>

<!-- Constraints -->
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Constraints</property>
<child>
<object class="GtkListBox">
<property name="width-request">300</property>
<property name="selection-mode">none</property>
<style>
<class name="content" />
<class name="medium" />
</style>
<child>
<object class="AdwSwitchRow" id="constraint_enabled_row">
<property name="title" translatable="yes">Enabled</property>
<property name="subtitle" translatable="yes">Hold Ctrl to temporarily enable/disable
<object class="AdwSwitchRow" id="constraint_enabled_row">
<property name="title" translatable="yes">Enabled</property>
<property name="subtitle" translatable="yes">Hold Ctrl to temporarily enable/disable
constraints when this switch is off/on</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_one_to_one_row">
<property name="title" translatable="yes">1:1</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_three_to_two_row">
<property name="title" translatable="yes">3:2</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_golden_row">
<property name="title" translatable="yes">Golden Ratio (1:1.618)</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_one_to_one_row">
<property name="title" translatable="yes">1:1</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_three_to_two_row">
<property name="title" translatable="yes">3:2</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="constraint_golden_row">
<property name="title" translatable="yes">Golden Ratio (1:1.618)</property>
</object>
</child>
</object>
Expand Down Expand Up @@ -319,4 +359,4 @@ constraints when this switch is off/on</property>
</child>
</object>
</template>
</interface>
</interface>
9 changes: 7 additions & 2 deletions crates/rnote-ui/src/appwindow/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,12 @@ impl RnAppWindow {
obj.overlays()
.penssidebar()
.shaper_page()
.shapeconfig_menubutton()
.shapestyling_menubutton()
.set_direction(ArrowType::Right);
obj.overlays()
.penssidebar()
.shaper_page()
.shaperconfig_menubutton()
.set_direction(ArrowType::Right);
obj.overlays()
.penssidebar()
Expand Down Expand Up @@ -823,7 +828,7 @@ impl RnAppWindow {
obj.overlays()
.penssidebar()
.shaper_page()
.shapeconfig_menubutton()
.shapestyling_menubutton()
.set_direction(ArrowType::Left);
obj.overlays()
.penssidebar()
Expand Down
Loading