mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 03:32:29 +00:00
* Allow Frame's to be located in both rows and columns. Improved min
height/width for windows. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@748 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -44,7 +44,7 @@ namespace input {
|
||||
|
||||
bool
|
||||
Bindings::pressed(int key) {
|
||||
if (!m_active)
|
||||
if (!m_enabled)
|
||||
return false;
|
||||
|
||||
const_iterator itr = find(key);
|
||||
|
||||
@@ -63,17 +63,17 @@ public:
|
||||
|
||||
using Base::operator[];
|
||||
|
||||
Bindings() : m_active(true) {}
|
||||
Bindings() : m_enabled(true) {}
|
||||
|
||||
void activate() { m_active = true; }
|
||||
void disable() { m_active = false; }
|
||||
void enable() { m_enabled = true; }
|
||||
void disable() { m_enabled = false; }
|
||||
|
||||
bool pressed(int key);
|
||||
|
||||
void ignore(int key) { (*this)[key] = Slot(); }
|
||||
|
||||
private:
|
||||
bool m_active;
|
||||
bool m_enabled;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ PathInput::PathInput() :
|
||||
|
||||
bool
|
||||
PathInput::pressed(int key) {
|
||||
// Consider binding tab in m_bindings instead.
|
||||
|
||||
if (key != '\t') {
|
||||
m_showNext = false;
|
||||
return TextInput::pressed(key);
|
||||
|
||||
@@ -44,7 +44,10 @@ namespace input {
|
||||
|
||||
bool
|
||||
TextInput::pressed(int key) {
|
||||
if (m_alt) {
|
||||
if (m_bindings.pressed(key)) {
|
||||
return true;
|
||||
|
||||
} else if (m_alt) {
|
||||
m_alt = false;
|
||||
|
||||
switch (key) {
|
||||
@@ -123,7 +126,6 @@ TextInput::pressed(int key) {
|
||||
m_slotDirty();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
#define RTORRENT_INPUT_TEXT_INPUT_H
|
||||
|
||||
#include <string>
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
#include "bindings.h"
|
||||
|
||||
namespace input {
|
||||
|
||||
@@ -68,11 +69,15 @@ public:
|
||||
|
||||
std::string& str() { return *this; }
|
||||
|
||||
Bindings& bindings() { return m_bindings; }
|
||||
|
||||
private:
|
||||
size_type m_pos;
|
||||
|
||||
bool m_alt;
|
||||
SlotDirty m_slotDirty;
|
||||
|
||||
Bindings m_bindings;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user