Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #346 from ggalmazor/issue_338_detail_buttons_on_pu…
Browse files Browse the repository at this point in the history
…ll_and_push

Issue 338 detail button foreground on push/pull tabs
  • Loading branch information
yanokwa authored Feb 5, 2018
2 parents d6639dc + 7448cdf commit 903efa7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/org/opendatakit/briefcase/ui/FormTransferTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package org.opendatakit.briefcase.ui;

import static java.awt.Color.DARK_GRAY;
import static java.awt.Color.LIGHT_GRAY;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
Expand Down Expand Up @@ -122,7 +125,8 @@ public static class DetailButton extends JButton implements ActionListener {
// Use custom fonts instead of png for easier scaling
this.setFont(ic_receipt); // custom font that overrides  with a receipt icon
this.setToolTipText("View this form's status history");
this.setMargin(new Insets(0,0,0,0));
this.setForeground(LIGHT_GRAY);
this.setMargin(new Insets(0, 0, 0, 0));
this.status = status;
this.addActionListener(this);
log.debug("creating details button");
Expand Down Expand Up @@ -384,6 +388,13 @@ public void formsAvailableFromServer(RetrieveAvailableFormsSucceededEvent event)
}
}

@EventSubscriber(eventClass = FormStatusEvent.class)
public void onFormStatusEvent(FormStatusEvent event) {
((FormTransferTableModel) dataModel).buttonMap.forEach((form, button) ->
button.setForeground(form.getStatusHistory().isEmpty() ? LIGHT_GRAY : DARK_GRAY)
);
}

public List<FormStatus> getSelectedForms() {
FormTransferTableModel model = (FormTransferTableModel) this.dataModel;
return model.getSelectedForms();
Expand Down

0 comments on commit 903efa7

Please sign in to comment.