Skip to content

Fold TipLangBarToggleButton into TipLangBarButton - #1614

Open
yukawa wants to merge 1 commit into
google:masterfrom
ciceroaware:issue_1600_step1
Open

yukawa wants to merge 1 commit into
google:masterfrom
ciceroaware:issue_1600_step1

Conversation

@yukawa

@yukawa yukawa commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

In preparation for renaming tip_lang_bar* to something more appropriate (#1600), this commit simplifies the code by folding no-longer-needed abstractions into TipLangBarButton to make the renaming easier.

This is doable because the legacy floating language bar support was removed recently (6a4cd62). The only remaining language bar item is the input mode button shown in the system tray, which is always a non-menu button with TF_LBI_STYLE_SHOWNINTRAY.

The class hierarchy changes as follows:

  Before:
    TipLangBarButton
      implements ITfLangBarItemButton, ITfSource, IMozcLangBarItem
    TipLangBarToggleButton
      extends TipLangBarButton
      implements IMozcLangBarToggleItem
      (overrides QueryInterface, AddRef, and Release because of the
      multiple inheritance)

  After:
    TipLangBarButton
      implements ITfLangBarItemButton, ITfSource

There must be no observable behavior change. Changes in GetStatus() and OnMenuSelect() should be safe for the current code paths.

Issue IDs

Steps to test new behaviors (if any)

  • OS: Windows 11 26H2
  • Steps:
    1. Confirm the mode icon in the system tray keeps working as it was

Additional context

Before:

classDiagram
  direction BT
  class ITfLangBarItemButton
  <<interface>> ITfLangBarItemButton
  class ITfSource
  <<interface>> ITfSource
  class IMozcLangBarItem
  <<interface>> IMozcLangBarItem
  class IMozcLangBarToggleItem
  <<interface>> IMozcLangBarToggleItem

  TipLangBarButton ..|> ITfLangBarItemButton
  TipLangBarButton ..|> ITfSource
  TipLangBarButton ..|> IMozcLangBarItem
  TipLangBarToggleButton --|> TipLangBarButton
  TipLangBarToggleButton ..|> IMozcLangBarToggleItem
  TipLangBar --> TipLangBarToggleButton
Loading

After:

classDiagram
  direction BT
  class ITfLangBarItemButton
  <<interface>> ITfLangBarItemButton
  class ITfSource
  <<interface>> ITfSource

  TipLangBarToggleButton ..|> ITfLangBarItemButton
  TipLangBarToggleButton ..|> ITfSource
  TipLangBar --> TipLangBarToggleButton
Loading

In preparation for renaming tip_lang_bar* to something more appropriate
(google#1600), this commit simplifies the code by folding no-longer-needed
abstractions into TipLangBarButton to make the renaming easier.

This is doable because the legacy floating language bar support was
removed recently [1]. The only remaining language bar item is the input
mode button shown in the system tray, which is always a non-menu button
with TF_LBI_STYLE_SHOWNINTRAY.

The class hierarchy changes as follows:

  Before:
    TipLangBarButton
      implements ITfLangBarItemButton, ITfSource, IMozcLangBarItem
    TipLangBarToggleButton
      extends TipLangBarButton
      implements IMozcLangBarToggleItem
      (overrides QueryInterface, AddRef, and Release because of the
      multiple inheritance)

  After:
    TipLangBarButton
      implements ITfLangBarItemButton, ITfSource

There must be no observable behavior change. Changes in GetStatus() and
OnMenuSelect() should be safe for the current code paths.

 [1]: 6a4cd62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant