Skip to content

Add CSS selector for expanded drawers#4977

Open
Diax170 wants to merge 4 commits intoAlexays:masterfrom
Diax170:drawer-state
Open

Add CSS selector for expanded drawers#4977
Diax170 wants to merge 4 commits intoAlexays:masterfrom
Diax170:drawer-state

Conversation

@Diax170
Copy link
Copy Markdown

@Diax170 Diax170 commented Apr 7, 2026

Adds a .expanded CSS class for expanded group drawers

Partially resolves discussion #3900

@Diax170
Copy link
Copy Markdown
Author

Diax170 commented Apr 28, 2026

I also came up with this snippet, which adds on-expanded and on-collapsed config options:

void Group::show_group() {
  box.set_state_flags(Gtk::StateFlags::STATE_FLAG_PRELIGHT);
  revealer.set_reveal_child(true);
  box.get_style_context()->add_class("expanded");

  if (config_["drawer"].isObject()) {
    if (config_["drawer"]["on-expand"].isString() && revealer.get_reveal_child()) {
      pid_children_.push_back(util::command::forkExec(config_["drawer"]["on-expand"].asString()));
    }
  }
}

void Group::hide_group() {
  box.unset_state_flags(Gtk::StateFlags::STATE_FLAG_PRELIGHT);
  revealer.set_reveal_child(false);
  box.get_style_context()->remove_class("expanded");

  if (config_["drawer"].isObject()) {
    if (config_["drawer"]["on-collapse"].isString() && !revealer.get_reveal_child()) {
      pid_children_.push_back(util::command::forkExec(config_["drawer"]["on-collapse"].asString()));
    }
  }
}

but ultimately gave it up because it was too buggy. If anyone wants to get this feature added in, feel free to discuss

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