pidgin/resources/Conversations/conversation.ui

Fri, 01 Nov 2024 01:31:09 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 01 Nov 2024 01:31:09 -0500
changeset 43041
ea212a081e9c
parent 42943
d453240767f9
child 43093
27f816a512af
permissions
-rw-r--r--

Make the text in the infopanes selectable

This also removes the tooltip and instead expands the widget out while hovering
the cursor over the label.

Testing Done:
Joined a channel on a local ergo server that had a long topic with links. Link behavior works in all cases except when text is selected which is fine. If you click some where in the label to clear the selection links work again. Also verified the hover behavior. I'm not a fan of using 10 lines as a magic number, but it should be fine for now.

Bugs closed: PIDGIN-2582

Reviewed at https://reviews.imfreedom.org/r/3610/

<?xml version="1.0" encoding="UTF-8"?>
<!--
Pidgin - Internet Messenger
Copyright (C) Pidgin Developers <devel@pidgin.im>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
-->
<interface>
  <requires lib="gtk" version="4.0"/>
  <!-- interface-license-type gplv2 -->
  <!-- interface-name Pidgin -->
  <!-- interface-description Internet Messenger -->
  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
  <template class="PidginConversation" parent="GtkBox">
    <property name="orientation">vertical</property>
    <child>
      <object class="GtkBox">
        <property name="orientation">horizontal</property>
        <property name="vexpand">0</property>
        <child>
          <object class="PidginInfoPane" id="info_pane">
            <property name="hexpand">1</property>
            <binding name="title">
              <lookup name="title-for-display" type="PurpleConversation">
                <lookup name="conversation">PidginConversation</lookup>
              </lookup>
            </binding>
            <binding name="subtitle">
              <closure type="gchararray" function="pidgin_conversation_escape_topic">
                <lookup name="topic" type="PurpleConversation">
                  <lookup name="conversation">PidginConversation</lookup>
                </lookup>
              </closure>
            </binding>
            <property name="child">
              <object class="GtkBox">
                <property name="orientation">horizontal</property>
                <property name="valign">start</property>
                <child>
                  <object class="GtkToggleButton" id="toggle_flap">
                    <property name="icon-name">view-dual-symbolic</property>
                    <property name="valign">center</property>
                  </object>
                </child>
              </object>
            </property>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="AdwOverlaySplitView">
        <property name="sidebar-position">end</property>
        <property name="enable-hide-gesture">true</property>
        <property name="enable-show-gesture">true</property>
        <binding name="show-sidebar">
          <lookup name="active">toggle_flap</lookup>
        </binding>
        <property name="content">
          <object class="GtkScrolledWindow">
            <property name="hexpand">1</property>
            <property name="vadjustment">
              <object class="PidginAutoAdjustment" id="history_adjustment"/>
            </property>
            <property name="vexpand">1</property>
            <child>
              <object class="GtkListView" id="history">
                <property name="hexpand">1</property>
                <property name="vexpand">1</property>
                <property name="factory">
                  <object class="GtkBuilderListItemFactory">
                    <property name="resource">/im/pidgin/Pidgin3/Conversations/message.ui</property>
                  </object>
                </property>
                <property name="model">
                  <object class="GtkNoSelection">
                    <binding name="model">
                      <lookup name="messages" type="PurpleConversation">
                        <lookup name="conversation">PidginConversation</lookup>
                      </lookup>
                    </binding>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </property>
        <property name="sidebar">
          <object class="GtkScrolledWindow">
            <property name="hscrollbar-policy">never</property>
            <property name="margin-bottom">6</property>
            <property name="margin-end">6</property>
            <property name="margin-start">6</property>
            <property name="margin-top">6</property>
            <property name="vscrollbar-policy">automatic</property>
            <style>
              <class name="sidebar"/>
            </style>
            <child>
              <object class="GtkListView">
                <property name="vexpand">1</property>
                <property name="factory">
                  <object class="GtkBuilderListItemFactory">
                    <property name="resource">/im/pidgin/Pidgin3/conversationmemberlistitem.ui</property>
                  </object>
                </property>
                <property name="model">
                  <object class="GtkSingleSelection">
                    <property name="autoselect">false</property>
                    <property name="model">
                      <object class="GtkSortListModel">
                        <property name="sorter">
                          <object class="GtkCustomSorter" id="memberlist_sorter"/>
                        </property>
                        <binding name="model">
                          <lookup name="members" type="PurpleConversation">
                            <lookup name="conversation">PidginConversation</lookup>
                          </lookup>
                        </binding>
                      </object>
                    </property>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </property>
      </object>
    </child>
    <child>
      <object class="PidginTypingLabel">
        <binding name="conversation">
          <lookup name="conversation">PidginConversation</lookup>
        </binding>
      </object>
    </child>
    <child>
      <object class="GtkScrolledWindow">
        <property name="vexpand">0</property>
        <child>
          <object class="GtkTextView" id="input">
            <property name="wrap-mode">word-char</property>
            <property name="input-purpose">free-form</property>
            <property name="input-hints">emoji|spellcheck|word-completion</property>
            <property name="buffer">
              <object class="GtkTextBuffer">
                <signal name="delete-range" handler="pidgin_conversation_input_delete_range_cb" after="yes"/>
                <signal name="insert-text" handler="pidgin_conversation_input_insert_text_cb"/>
              </object>
            </property>
            <child>
              <object class="GtkEventControllerKey">
                <signal name="key-pressed" handler="pidgin_conversation_input_key_pressed_cb"/>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>

mercurial