- Re-add text popup timer in config
- Add 1hz redraw when in text popup mode - Added condition to voice 1hz redraw
This commit is contained in:
parent
f7058f7171
commit
5634064d17
4 changed files with 137 additions and 87 deletions
|
|
@ -110,6 +110,13 @@
|
|||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="text_popup_time_adj">
|
||||
<property name="lower">30</property>
|
||||
<property name="upper">5000</property>
|
||||
<property name="value">30</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
<object class="GtkListStore" id="voice_align_1_list">
|
||||
<columns>
|
||||
<!-- column-name key -->
|
||||
|
|
@ -1451,7 +1458,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<!-- n-columns=2 n-rows=12 -->
|
||||
<!-- n-columns=2 n-rows=13 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="name">text_grid</property>
|
||||
<property name="visible">True</property>
|
||||
|
|
@ -1517,30 +1524,6 @@
|
|||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_server_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Server</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="name">text_server</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_line_limit_label</property>
|
||||
|
|
@ -1551,7 +1534,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">11</property>
|
||||
<property name="top-attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -1559,12 +1542,26 @@
|
|||
<property name="name">text_line_limit</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="text" translatable="yes">10</property>
|
||||
<property name="adjustment">text_line_limit_adj</property>
|
||||
<property name="value">10</property>
|
||||
<signal name="value-changed" handler="text_line_limit_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_show_attachments_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Show Attachments</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -1579,15 +1576,15 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">10</property>
|
||||
<property name="top-attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_show_attachments_label</property>
|
||||
<property name="name">text_overlay_location_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Show Attachments</property>
|
||||
<property name="label" translatable="yes">Overlay Location</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -1606,21 +1603,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_overlay_location_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Overlay Location</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">8</property>
|
||||
<property name="height">2</property>
|
||||
<property name="top-attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -1632,6 +1615,19 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_background_colour_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Background Colour</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -1646,6 +1642,19 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_colour_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Text Colour</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -1660,35 +1669,9 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_background_colour_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Background Colour</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_colour_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Text Colour</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFontButton">
|
||||
<property name="name">text_font</property>
|
||||
|
|
@ -1702,7 +1685,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">5</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -1713,6 +1696,19 @@
|
|||
<property name="label" translatable="yes">Font</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_channel_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Channel</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">5</property>
|
||||
|
|
@ -1726,20 +1722,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_channel_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Channel</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">4</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -1753,9 +1736,62 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_server_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Server</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="name">text_server</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="name">text_popup_time_label</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Popup time limit</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton">
|
||||
<property name="name">text_popup_time</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">text_popup_time_adj</property>
|
||||
<signal name="value-changed" handler="text_popup_time_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
|
|
|||
|
|
@ -403,6 +403,10 @@ class MainSettingsWindow():
|
|||
self.widget['text_popup_style'].set_active(
|
||||
config.getboolean("text", "popup_style", fallback=False))
|
||||
|
||||
self.widget['text_popup_time'].set_value(
|
||||
config.getint("text","text_time", fallback=30)
|
||||
)
|
||||
|
||||
self.current_guild = config.get("text", "guild", fallback="0")
|
||||
|
||||
self.current_channel = config.get("text", "channel", fallback="0")
|
||||
|
|
@ -951,6 +955,9 @@ class MainSettingsWindow():
|
|||
def text_popup_style_changed(self, button):
|
||||
self.config_set("text", "popup_style", "%s" % (button.get_active()))
|
||||
|
||||
def text_popup_time_changed(self, button):
|
||||
self.config_set("text", "text_time", "%s" % (int(button.get_value())))
|
||||
|
||||
def text_server_changed(self, button):
|
||||
if button.get_active() < 0:
|
||||
self.config_set("text", "guild", "0")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from .overlay import OverlayWindow
|
|||
gi.require_version("Gtk", "3.0")
|
||||
gi.require_version('PangoCairo', '1.0')
|
||||
# pylint: disable=wrong-import-position,wrong-import-order
|
||||
from gi.repository import Pango, PangoCairo # nopep8
|
||||
from gi.repository import Pango, PangoCairo, GLib # nopep8
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -54,6 +54,12 @@ class TextOverlayWindow(OverlayWindow):
|
|||
self.warned_filetypes = []
|
||||
self.set_title("Discover Text")
|
||||
self.redraw()
|
||||
GLib.timeout_add_seconds(1, self.set_need_redraw)
|
||||
|
||||
def set_need_redraw(self):
|
||||
if self.popup_style:
|
||||
self.needsredraw = True
|
||||
return True
|
||||
|
||||
def set_blank(self):
|
||||
self.content = []
|
||||
|
|
|
|||
|
|
@ -121,7 +121,8 @@ class VoiceOverlayWindow(OverlayWindow):
|
|||
GLib.timeout_add_seconds(1, self.set_need_redraw)
|
||||
|
||||
def set_need_redraw(self):
|
||||
self.needsredraw = True
|
||||
if self.only_speaking:
|
||||
self.needsredraw = True
|
||||
return True
|
||||
|
||||
def set_icon_transparency(self, trans):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue