pidgin/resources/display-item.ui

Fri, 28 Mar 2025 00:32:48 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 28 Mar 2025 00:32:48 -0500
changeset 43208
b81c104ccbe0
parent 42797
767b7685a4a4
permissions
-rw-r--r--

Fix an alignment issue with the conversation 3 vertical dots menu

If a conversation had notifications and you selected or hovered over it, the
notifications would hide, but the 3 vertical dots menu would be positioned
like the notifications were still visible.

Testing Done:
Joined a bunch of channels and waited for notifications to popup and then verified that the 3 vertical dots menu was in the correct place.

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

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <template class="GtkListItem">
    <property name="child">
      <object class="GtkTreeExpander" id="expander">
        <binding name="list-row">
          <lookup name="item">GtkListItem</lookup>
        </binding>
        <property name="child">
          <object class="GtkBox">
            <property name="orientation">horizontal</property>
            <property name="spacing">6</property>
            <binding name="tooltip-text">
              <lookup name="title" type="PidginDisplayItem">
                <lookup name="item">expander</lookup>
              </lookup>
            </binding>
            <child>
              <object class="GtkEventControllerMotion" id="motion_controller"/>
            </child>
            <child>
              <object class="GtkImage">
                <binding name="icon-name">
                  <lookup name="icon-name" type="PidginDisplayItem">
                    <lookup name="item">expander</lookup>
                  </lookup>
                </binding>
              </object>
            </child>
            <child>
              <object class="GtkLabel">
                <property name="xalign">0</property>
                <property name="hexpand">1</property>
                <property name="ellipsize">end</property>
                <binding name="label">
                  <lookup name="title" type="PidginDisplayItem">
                    <lookup name="item">expander</lookup>
                  </lookup>
                </binding>
              </object>
            </child>
            <child>
              <object class="GtkStack">
                <property name="transition-type">crossfade</property>
                <binding name="visible-child-name">
                  <closure type="gchararray" function="pidgin_display_window_show_item_actions_cb">
                    <lookup name="selected">GtkListItem</lookup>
                    <lookup name="contains-pointer">motion_controller</lookup>
                    <lookup name="active">menu_button</lookup>
                  </closure>
                </binding>
                <child>
                  <object class="GtkStackPage">
                    <property name="name">notifications</property>
                    <property name="child">
                      <object class="GtkBox">
                        <property name="spacing">6</property>
                        <property name="halign">end</property>
                        <property name="hexpand">true</property>
                        <property name="orientation">horizontal</property>
                        <child>
                          <object class="GtkLabel">
                            <style>
                              <class name="notification-count"/>
                            </style>
                            <property name="valign">center</property>
                            <binding name="visible">
                              <lookup name="needs-attention" type="PidginDisplayItem">
                                <lookup name="item">expander</lookup>
                              </lookup>
                            </binding>
                            <binding name="label">
                              <lookup name="badge-number" type="PidginDisplayItem">
                                <lookup name="item">expander</lookup>
                              </lookup>
                            </binding>
                          </object>
                        </child>
                      </object>
                    </property>
                  </object>
                </child>
                <child>
                  <object class="GtkStackPage">
                    <property name="name">actions</property>
                    <property name="child">
                      <object class="GtkBox">
                        <property name="spacing">6</property>
                        <property name="halign">end</property>
                        <property name="hexpand">true</property>
                        <property name="orientation">horizontal</property>
                        <child>
                          <object class="GtkMenuButton" id="menu_button">
                            <style>
                              <class name="flat"/>
                            </style>
                            <property name="icon-name">view-more-symbolic</property>
                            <binding name="menu-model">
                              <lookup name="menu" type="PidginDisplayItem">
                                <lookup name="item">expander</lookup>
                              </lookup>
                            </binding>
                            <binding name="visible">
                              <closure type="gboolean" function="pidgin_display_window_show_item_menu_cb">
                                <lookup name="item">expander</lookup>
                              </closure>
                            </binding>
                          </object>
                        </child>
                      </object>
                    </property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </property>
      </object>
    </property>
  </template>
</interface>

mercurial