Skip to content

Commit

Permalink
Remove feature for using Entry instead of SearchEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Jan 11, 2016
1 parent 0807e2c commit 628cd57
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ cache:
- $HOME/local
script:
- rustc --version
- cargo test --no-default-features
- cargo build --no-default-features
- cargo test
- cargo build
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ toml = "^0"
itertools = "^0"
regex = "^0"

[features]
default = ["search_entry"]
search_entry = []

[[bin]]
name = "rrun"
15 changes: 1 addition & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ mod externalrunner;
mod execution;


#[cfg(feature="search_entry")]
fn get_entry_field() -> gtk::SearchEntry {
gtk::SearchEntry::new().unwrap_or_else(|| panic!("Unable to instantiate GTK::SearchEntry!"))
}

#[cfg(not(feature="search_entry"))]
fn get_entry_field() -> gtk::Entry {
gtk::Entry::new().unwrap_or_else(|| panic!("Unable to instantiate GTK::Entry!"))
}

fn append_text_column(tree: &gtk::TreeView) {
let column = gtk::TreeViewColumn::new().unwrap();
let cell = gtk::CellRendererText::new().unwrap();
Expand Down Expand Up @@ -115,11 +105,8 @@ fn main() {
let builder = widgets::Builder::new_from_string(glade_src).unwrap();
let (window, entry, completion_list) = unsafe {
let window: gtk::Window = builder.get_object("rrun").unwrap();
let container: gtk::widgets::Box = builder.get_object("container").unwrap();
let completion_list: gtk::widgets::TreeView = builder.get_object("completion_view").unwrap();
let entry = get_entry_field();
container.add(&entry);
container.reorder_child(&entry, 0);
let entry: gtk::widgets::SearchEntry = builder.get_object("search_entry").unwrap();
window.connect_delete_event(|_, _| {
gtk::main_quit();
Inhibit(false)
Expand Down
23 changes: 20 additions & 3 deletions src/rrun.glade
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,38 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="activates_default">True</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTreeView" id="completion_view">
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
<object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
</object>
Expand Down

0 comments on commit 628cd57

Please sign in to comment.