candidatePanel: Remove hardcoded styling

The styling should be done in the CSS file.
This commit is contained in:
Rui Matos 2012-05-03 11:34:30 +02:00
parent 1a24f061cf
commit de8106967d

View File

@ -33,11 +33,6 @@ const ORIENTATION_HORIZONTAL = 0;
const ORIENTATION_VERTICAL = 1; const ORIENTATION_VERTICAL = 1;
const ORIENTATION_SYSTEM = 2; const ORIENTATION_SYSTEM = 2;
const topLabelStyle = 'padding: .1em 0em';
const candidateLabelStyle = 'padding: .1em 0em .1em 0em';
const candidateTextStyle = 'padding: .1em 0em .1em 0em';
const separatorStyle = 'height: 2px; padding: 0em';
function StCandidateArea(orientation) { function StCandidateArea(orientation) {
this._init(orientation); this._init(orientation);
} }
@ -80,12 +75,10 @@ StCandidateArea.prototype = {
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
let label1 = new St.Label({ text: '1234567890abcdef'.charAt(i) + '.', let label1 = new St.Label({ text: '1234567890abcdef'.charAt(i) + '.',
style_class: 'popup-menu-item', style_class: 'popup-menu-item',
style: candidateLabelStyle,
reactive: true }); reactive: true });
let label2 = new St.Label({ text: '' , let label2 = new St.Label({ text: '' ,
style_class: 'popup-menu-item', style_class: 'popup-menu-item',
style: candidateTextStyle,
reactive: true }); reactive: true });
if (this._orientation == ORIENTATION_VERTICAL) { if (this._orientation == ORIENTATION_VERTICAL) {
@ -261,13 +254,11 @@ CandidatePanel.prototype = {
this._boxPointer.bin.set_child(this._stCandidatePanel); this._boxPointer.bin.set_child(this._stCandidatePanel);
this._stPreeditLabel = new St.Label({ style_class: 'popup-menu-item', this._stPreeditLabel = new St.Label({ style_class: 'popup-menu-item',
style: topLabelStyle,
text: '' }); text: '' });
if (!this._preeditVisible) { if (!this._preeditVisible) {
this._stPreeditLabel.hide(); this._stPreeditLabel.hide();
} }
this._stAuxLabel = new St.Label({ style_class: 'popup-menu-item', this._stAuxLabel = new St.Label({ style_class: 'popup-menu-item',
style: topLabelStyle,
text: '' }); text: '' });
if (!this._auxVisible) { if (!this._auxVisible) {
this._stAuxLabel.hide(); this._stAuxLabel.hide();
@ -603,8 +594,7 @@ function Separator() {
Separator.prototype = { Separator.prototype = {
_init: function() { _init: function() {
this.actor = new St.DrawingArea({ style_class: 'popup-separator-menu-item', this.actor = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
style: separatorStyle });
this.actor.connect('repaint', Lang.bind(this, this._onRepaint)); this.actor.connect('repaint', Lang.bind(this, this._onRepaint));
}, },