Skip to content

Commit

Permalink
improved ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed May 26, 2024
1 parent 2f6c875 commit 5d2e8a5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 36 deletions.
6 changes: 2 additions & 4 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class TeleprompterWindow(Adw.ApplicationWindow):
fullscreen_button = Gtk.Template.Child("fullscreen_button")
overlay = Gtk.Template.Child("overlay")

main = Gtk.Template.Child("main")

playing = False
fullscreened = False

Expand Down Expand Up @@ -340,7 +338,7 @@ def modifyFont(self, amount):

@Gtk.Template.Callback("play_button_clicked")
def bar1(self, *args):
print("play")
# print("play")
if not self.playing:
self.start_button1.set_icon_name("media-playback-pause-symbolic")
self.playing = True
Expand Down Expand Up @@ -375,7 +373,7 @@ def bar5(self, *args):

def callback(clipboard, res, data):
text = clipboard.read_text_finish(res)
self.text_buffer.set_text("\n\n" + text + "\n\n\n\n\n\n\n\n\n")
self.text_buffer.set_text("\n\n" + text)
self.apply_text_tags()
self.updateFont()
start = self.text_buffer.get_start_iter()
Expand Down
57 changes: 25 additions & 32 deletions src/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
<property name="title">Teleprompter</property>
<child>
<object class="AdwBreakpoint">
<condition>max-width: 400px</condition>
<condition>max-width: 480px</condition>
<setter object="bottom_controls" property="visible">true</setter>
<setter object="sidebar_controls" property="visible">false</setter>
<setter object="text_view" property="margin_start">12</setter>
</object>
</child>
<child>
Expand Down Expand Up @@ -132,14 +133,14 @@
</object>
</child>
<property name="content">
<object class="GtkBox" id="main">
<child>
<object class="GtkOverlay">
<child type="overlay">
<object class="GtkBox" id="sidebar_controls">
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<property name="margin-start">10</property>
<property name="spacing">6</property>
<property name="margin-start">12</property>
<property name="valign">center</property>
<property name="halign">center</property>
<property name="halign">start</property>
<property name="css-classes">toolbar
osd</property>
<child>
Expand Down Expand Up @@ -203,25 +204,27 @@ osd</property>
</object>
</child>
<child>
<object class="AdwClamp">
<property name="maximum-size">2600</property>
<property name="margin-start">0</property>
<property name="margin-end">0</property>
<property name="tightening-threshold">1000</property>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="hscrollbar-policy">never</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<child>
<object class="AdwToastOverlay" id="overlay">
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="hscrollbar-policy">never</property>
<child>
<object class="AdwClamp">
<property name="maximum-size">2600</property>
<property name="margin-start">0</property>
<property name="margin-end">0</property>
<property name="tightening-threshold">1000</property>
<property name="vexpand">True</property>
<child>
<property name="hexpand">True</property>
<child>
<object class="AdwToastOverlay" id="overlay">
<child>

<object class="GtkTextView" id="text_view">
<property name="vexpand">True</property>
<property name="buffer">text_buffer</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="bottom-margin">300</property>
<property name="margin-start">80</property>
<property name="margin-end">12</property>
<property name="cursor-visible">1</property>
<property name="editable">1</property>
<property name="justification">left</property>
Expand All @@ -244,23 +247,13 @@ osd</property>
</child>
</template>
<object class="GtkTextBuffer" id="text_buffer">
<property name="text" translatable="yes">
[START]
<property name="text" translatable="yes">[START]
This app can be used to read a script from the screen, just paste or open a text file.
Anything between square brackets like [this] is highlighted.

[Customization]
The font, color of the text and highlights can be customized.






</property>
The font, color of the text and highlights can be customized.</property>
</object>


<menu id="primary_menu">
<section>
<item>
Expand Down

0 comments on commit 5d2e8a5

Please sign in to comment.