pidgin/resources/Conversations/conversation.ui

Mon, 03 Feb 2025 21:11:44 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 03 Feb 2025 21:11:44 -0600
changeset 43173
399e2538f319
parent 43150
fb0660fc1877
child 43186
f869ebb47d88
permissions
-rw-r--r--

Implement searching the conversation members

This replaces the label that showed how many members are in the conversation
but that text is now used as the placeholder text in the search widget.

Testing Done:
Joined a channel on a local ergo server and tested a few matches.

Bugs closed: PIDGIN-18039

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

<?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="margin-bottom">12</property>
                <property name="margin-end">12</property>
                <property name="margin-start">12</property>
                <property name="margin-top">12</property>
                <property name="orientation">horizontal</property>
                <property name="valign">start</property>
                <child>
                  <object class="GtkToggleButton" id="toggle_flap">
                    <property name="icon-name">system-users-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="GtkSignalListItemFactory">
                    <signal name="setup" handler="pidgin_conversation_message_setup"/>
                    <signal name="bind" handler="pidgin_conversation_message_bind"/>
                    <signal name="unbind" handler="pidgin_conversation_message_unbind"/>
                  </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="GtkBox">
            <property name="orientation">vertical</property>
            <property name="vexpand">true</property>
            <child>
              <object class="GtkSearchEntry" id="member_list_search_entry">
                <binding name="placeholder-text">
                  <closure type="gchararray" function="pidgin_conversation_conversation_members_items_changed">
                    <lookup name="n_items" type="PurpleConversationMembers">
                      <lookup name="members" type="PurpleConversation">
                        <lookup name="conversation">PidginConversation</lookup>
                      </lookup>
                    </lookup>
                  </closure>
                </binding>
                <signal name="search-changed" handler="pidgin_conversation_members_search_changed_cb"/>
              </object>
            </child>
            <child>
              <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="GtkFilterListModel" id="member_list_filter_model">
                            <property name="incremental">0</property>
                            <property name="filter">
                              <object class="GtkCustomFilter" id="member_list_filter"/>
                            </property>
                            <property name="model">
                              <object class="GtkSortListModel">
                                <property name="sorter">
                                  <object class="GtkCustomSorter" id="member_list_sorter"/>
                                </property>
                                <binding name="model">
                                  <lookup name="members" type="PurpleConversation">
                                    <lookup name="conversation">PidginConversation</lookup>
                                  </lookup>
                                </binding>
                              </object>
                            </property>
                          </object>
                        </property>
                      </object>
                    </property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </property>
      </object>
    </child>
    <child>
      <object class="GtkStack">
        <child>
          <object class="GtkStackPage">
            <property name="child">
              <object class="PidginTypingLabel" id="typing_label">
                <binding name="conversation">
                  <lookup name="conversation">PidginConversation</lookup>
                </binding>
              </object>
            </property>
          </object>
        </child>
        <child>
          <object class="GtkStackPage">
            <property name="child">
              <object class="GtkLabel" id="status_label">
                <property name="ellipsize">end</property>
                <property name="xalign">0</property>
                <property name="halign">fill</property>
                <property name="hexpand">true</property>
                <binding name="label">
                  <closure type="gchararray" function="pidgin_conversation_get_status_label">
                    <lookup name="error" type="PurpleConversation">
                      <lookup name="conversation">PidginConversation</lookup>
                    </lookup>
                    <lookup name="online" type="PurpleConversation">
                      <lookup name="conversation">PidginConversation</lookup>
                    </lookup>
                  </closure>
                </binding>
              </object>
            </property>
          </object>
        </child>
        <binding name="visible-child">
          <closure type="GtkWidget" function="pidgin_conversation_get_status_page">
            <lookup name="error" type="PurpleConversation">
              <lookup name="conversation">PidginConversation</lookup>
            </lookup>
            <lookup name="online" type="PurpleConversation">
              <lookup name="conversation">PidginConversation</lookup>
            </lookup>
          </closure>
        </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