save workspace names, and some fixes for menu behavior
This commit is contained in:
parent
d39a5489b1
commit
18cd70f749
6 changed files with 32 additions and 9 deletions
|
@ -1,5 +1,12 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 1.0.0:
|
||||
*07/07/07:
|
||||
* Right clicking on a submenu didn't revert focus to its parent (Mark)
|
||||
FbTk/Menu.cc/hh
|
||||
* Pressing escape in a torn menu didn't work (Mark)
|
||||
FbTk/Menu.cc
|
||||
* Save workspace names when changing through menu, bug #1748967 (Mark)
|
||||
Workspace.cc Screen.cc/hh
|
||||
*07/07/06:
|
||||
* When saving window information, use the class name instead of instance name
|
||||
by default (Mark)
|
||||
|
|
|
@ -358,9 +358,6 @@ void Menu::enterSubmenu() {
|
|||
|
||||
void Menu::enterParent() {
|
||||
internal_hide();
|
||||
// return focus to parent
|
||||
if (parent())
|
||||
parent()->grabInputFocus();
|
||||
}
|
||||
|
||||
void Menu::disableTitle() {
|
||||
|
@ -583,11 +580,11 @@ void Menu::redrawFrame(FbDrawable &drawable) {
|
|||
|
||||
}
|
||||
|
||||
void Menu::internal_hide() {
|
||||
void Menu::internal_hide(bool first) {
|
||||
|
||||
if (validIndex(m_which_sub)) {
|
||||
MenuItem *tmp = menuitems[m_which_sub];
|
||||
tmp->submenu()->internal_hide();
|
||||
tmp->submenu()->internal_hide(false);
|
||||
}
|
||||
|
||||
// if we have an active index we need to redraw it
|
||||
|
@ -596,12 +593,20 @@ void Menu::internal_hide() {
|
|||
m_active_index = -1;
|
||||
clearItem(old); // clear old area from highlight
|
||||
|
||||
if (shown && shown->menu.window == menu.window)
|
||||
shown = (Menu *) 0;
|
||||
if (shown && shown->menu.window == menu.window) {
|
||||
if (m_parent && m_parent->isVisible())
|
||||
shown = m_parent;
|
||||
else
|
||||
shown = (Menu *) 0;
|
||||
}
|
||||
|
||||
m_torn = m_visible = false;
|
||||
m_which_sub = -1;
|
||||
|
||||
if (first && m_parent && m_parent->isVisible() &&
|
||||
s_focused && !s_focused->isVisible())
|
||||
m_parent->grabInputFocus();
|
||||
|
||||
menu.window.hide();
|
||||
}
|
||||
|
||||
|
@ -1031,6 +1036,7 @@ void Menu::keyPressEvent(XKeyEvent &event) {
|
|||
break;
|
||||
case XK_Escape: // close menu
|
||||
m_type_ahead.reset();
|
||||
m_torn = false;
|
||||
hide();
|
||||
break;
|
||||
case XK_BackSpace:
|
||||
|
|
|
@ -191,7 +191,7 @@ protected:
|
|||
virtual void redrawTitle(FbDrawable &pm);
|
||||
virtual void redrawFrame(FbDrawable &pm);
|
||||
|
||||
virtual void internal_hide();
|
||||
virtual void internal_hide(bool first = true);
|
||||
|
||||
void update(FbTk::Subject *);
|
||||
|
||||
|
|
|
@ -1036,6 +1036,14 @@ void BScreen::rereadMenu() {
|
|||
m_rootmenu->reconfigure();
|
||||
}
|
||||
|
||||
void BScreen::updateWorkspaceName(unsigned int w) {
|
||||
Workspace *space = getWorkspace(w);
|
||||
if (space) {
|
||||
m_workspace_names[w] = space->name();
|
||||
updateWorkspaceNamesAtom();
|
||||
Fluxbox::instance()->save_rc();
|
||||
}
|
||||
}
|
||||
|
||||
void BScreen::removeWorkspaceNames() {
|
||||
m_workspace_names.clear();
|
||||
|
|
|
@ -347,6 +347,8 @@ public:
|
|||
*/
|
||||
void leftWorkspace(int delta);
|
||||
|
||||
/// update workspace name for given workspace
|
||||
void updateWorkspaceName(unsigned int w);
|
||||
/// remove all workspace names
|
||||
void removeWorkspaceNames();
|
||||
/// update the workspace name atom
|
||||
|
|
|
@ -382,7 +382,7 @@ void Workspace::setName(const string &name) {
|
|||
m_name = tname;
|
||||
}
|
||||
|
||||
screen().updateWorkspaceNamesAtom();
|
||||
screen().updateWorkspaceName(m_id);
|
||||
|
||||
menu().setLabel(m_name);
|
||||
menu().updateMenu();
|
||||
|
|
Loading…
Reference in a new issue