pidgin/resources/Conversations/message.ui

Tue, 10 Oct 2023 03:02:41 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 10 Oct 2023 03:02:41 -0500
changeset 42350
0d5319e4b836
parent 42346
45d2756d2a14
child 42380
165c0b7f3860
permissions
-rw-r--r--

Add tooltips to timestamps in PidginConversation

This allows you to get a tooltip for the timestamp and the edited label that
displays the time in the locale's default format. The edited label was tested
by forcing the demo protocol plugin to mark messages as edited.

Testing Done:
Sent a bunch of messages with the echo bot and verified the timestamp tooltip on IRCv3 as well.

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

<?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"/>
  <template class="GtkListItem">
    <property name="child">
      <object class="GtkBox">
        <child>
          <object class="GtkImage" id="avatar">
            <property name="icon-name">image-missing</property>
            <property name="visible">0</property>
          </object>
        </child>
        <child>
          <object class="GtkBox">
            <property name="hexpand">1</property>
            <property name="orientation">vertical</property>
            <child>
              <object class="GtkBox">
                <property name="spacing">8</property>
                <child>
                  <object class="GtkLabel" id="author">
                    <binding name="label">
                      <lookup name="author" type="PurpleMessage">
                        <lookup name="item">GtkListItem</lookup>
                      </lookup>
                    </binding>
                    <binding name="attributes">
                      <closure type="PangoAttrList" function="pidgin_conversation_get_author_attributes">
                        <lookup name="item">GtkListItem</lookup>
                      </closure>
                    </binding>
                  </object>
                </child>
                <child>
                  <object class="GtkLabel" id="timestamp">
                    <binding name="label">
                      <closure type="gchararray" function="pidgin_converation_get_timestamp_string">
                        <lookup name="item">GtkListItem</lookup>
                      </closure>
                    </binding>
                    <property name="has-tooltip">1</property>
                    <signal name="query-tooltip" handler="pidgin_conversation_query_tooltip_timestamp_cb"/>
                  </object>
                </child>
                <child>
                  <object class="GtkLabel" id="edited">
                    <binding name="visible">
                      <lookup name="edited" type="PurpleMessage">
                        <lookup name="item">GtkListItem</lookup>
                      </lookup>
                    </binding>
                    <property name="label" translatable="yes">(edited)</property>
                    <property name="has-tooltip">1</property>
                    <signal name="query-tooltip" handler="pidgin_conversation_query_tooltip_edited_cb"/>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="content">
                <property name="wrap">1</property>
                <property name="wrap-mode">word-char</property>
                <property name="xalign">0</property>
                <property name="yalign">0</property>
                <property name="use-markup">1</property>
                <binding name="label">
                  <lookup name="contents" type="PurpleMessage">
                    <lookup name="item">GtkListItem</lookup>
                  </lookup>
                </binding>
              </object>
            </child>
          </object>
        </child>
      </object>
    </property>
  </template>
</interface>

mercurial