Skip to content

Commit

Permalink
Merge pull request #10 from secondsun/keyboard_navigation
Browse files Browse the repository at this point in the history
Added styling and support for navigating items via keyboard
  • Loading branch information
cewee committed Feb 10, 2013
2 parents b4dcb65 + b279198 commit 1c6e4ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extension.js
Expand Up @@ -22,6 +22,7 @@ const IconGrid = imports.ui.iconGrid;
const Util = imports.misc.util;
const Tracker = imports.gi.Tracker;
const St = imports.gi.St;
const Atk = imports.gi.Atk;

/* let xdg-open pick the appropriate program to open/execute the file */
const DEFAULT_EXEC = 'xdg-open';
Expand All @@ -43,7 +44,11 @@ function TrackerResult(result) {
// Overwriting layout to display search results.
TrackerResult.prototype = {
_init: function(resultMeta) {
this.actor = new St.Bin({ reactive: true});
this.actor = new St.Bin({ style_class: 'result',
reactive: true,
can_focus: true,
track_hover: true,
accessible_role: Atk.Role.PUSH_BUTTON});
var MainBox = new St.BoxLayout( { style_class: 'result-content', vertical: true });
this.actor.set_child(MainBox);
var icon = resultMeta.createIcon(ICON_SIZE);
Expand Down
22 changes: 22 additions & 0 deletions stylesheet.css
Expand Up @@ -31,6 +31,16 @@
background-color: rgba(0.0, 0.0, 0.0, 0.55);
color: white;
}

.result {
width: 272px; /* Same width as two normal results + spacing */
height: 118px; /* Aspect ratio = 1.75. Normal US business card ratio */
border-radius: 4px;
padding: 3px;
border: 1px rgba(0,0,0,0);
transition-duration: 100;
}

.result-content {
border-radius: 7px;
padding: 4px;
Expand All @@ -40,7 +50,19 @@
color: white;
}

.result:hover {
background-color: rgba(255,255,255,0.1);
transition-duration: 100;
}

.result:focus,
.app-well-app:focus > .overview-icon,
.search-result-content:focus > .overview-icon,
.result:selected,
.app-well-app:selected > .overview-icon,
.search-result-content:selected > .overview-icon {
background-color: rgba(255,255,255,0.33);
}

.tracker-grid {
border-radius: 7px;
Expand Down

0 comments on commit 1c6e4ee

Please sign in to comment.